MCPcopy Create free account
hub / github.com/Samsung/UTopia / operator<

Method operator<

external/jsoncpp/jsoncpp.cpp:2683–2698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2681}
2682
2683bool Value::CZString::operator<(const CZString &other) const {
2684 if (!cstr_)
2685 return index_ < other.index_;
2686 // return strcmp(cstr_, other.cstr_) < 0;
2687 // Assume both are strings.
2688 unsigned this_len = this->storage_.length_;
2689 unsigned other_len = other.storage_.length_;
2690 unsigned min_len = std::min<unsigned>(this_len, other_len);
2691 JSON_ASSERT(this->cstr_ && other.cstr_);
2692 int comp = memcmp(this->cstr_, other.cstr_, min_len);
2693 if (comp < 0)
2694 return true;
2695 if (comp > 0)
2696 return false;
2697 return (this_len < other_len);
2698}
2699
2700bool Value::CZString::operator==(const CZString &other) const {
2701 if (!cstr_)

Callers

nothing calls this directly

Calls 3

decodePrefixedStringFunction · 0.85
typeMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected