MCPcopy Create free account
hub / github.com/Illumina/paragraph / operator<

Method operator<

external/jsoncpp/jsoncpp.cpp:2779–2791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2777#endif
2778
2779bool Value::CZString::operator<(const CZString& other) const {
2780 if (!cstr_) return index_ < other.index_;
2781 //return strcmp(cstr_, other.cstr_) < 0;
2782 // Assume both are strings.
2783 unsigned this_len = this->storage_.length_;
2784 unsigned other_len = other.storage_.length_;
2785 unsigned min_len = std::min<unsigned>(this_len, other_len);
2786 JSON_ASSERT(this->cstr_ && other.cstr_);
2787 int comp = memcmp(this->cstr_, other.cstr_, min_len);
2788 if (comp < 0) return true;
2789 if (comp > 0) return false;
2790 return (this_len < other_len);
2791}
2792
2793bool Value::CZString::operator==(const CZString& other) const {
2794 if (!cstr_) return index_ == other.index_;

Callers

nothing calls this directly

Calls 2

decodePrefixedStringFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected