MCPcopy Create free account
hub / github.com/ComodoSecurity/openedr / operator<

Method operator<

edrav2/eprj/jsoncpp/src/lib_json/json_value.cpp:331–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329#endif
330
331bool Value::CZString::operator<(const CZString& other) const {
332 if (!cstr_)
333 return index_ < other.index_;
334 // return strcmp(cstr_, other.cstr_) < 0;
335 // Assume both are strings.
336 unsigned this_len = this->storage_.length_;
337 unsigned other_len = other.storage_.length_;
338 unsigned min_len = std::min<unsigned>(this_len, other_len);
339 JSON_ASSERT(this->cstr_ && other.cstr_);
340 int comp = memcmp(this->cstr_, other.cstr_, min_len);
341 if (comp < 0)
342 return true;
343 if (comp > 0)
344 return false;
345 return (this_len < other_len);
346}
347
348bool Value::CZString::operator==(const CZString& other) const {
349 if (!cstr_)

Callers

nothing calls this directly

Calls 2

decodePrefixedStringFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected