MCPcopy Create free account
hub / github.com/SOUI2/soui / operator<

Method operator<

third-part/jsoncpp/src/lib_json/json_value.cpp:310–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308#endif
309
310bool Value::CZString::operator<(const CZString& other) const {
311 if (!cstr_) return index_ < other.index_;
312 //return strcmp(cstr_, other.cstr_) < 0;
313 // Assume both are strings.
314 unsigned this_len = this->storage_.length_;
315 unsigned other_len = other.storage_.length_;
316 unsigned min_len = std::min<unsigned>(this_len, other_len);
317 JSON_ASSERT(this->cstr_ && other.cstr_);
318 int comp = memcmp(this->cstr_, other.cstr_, min_len);
319 if (comp < 0) return true;
320 if (comp > 0) return false;
321 return (this_len < other_len);
322}
323
324bool Value::CZString::operator==(const CZString& other) const {
325 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