MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / operator<

Method operator<

Source/JSON/jsoncpp.cpp:2418–2429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2416}
2417
2418bool Value::CZString::operator<(const CZString& other) const {
2419 if (!cstr_) return index_ < other.index_;
2420 // return strcmp(cstr_, other.cstr_) < 0;
2421 // Assume both are strings.
2422 unsigned this_len = this->storage_.length_;
2423 unsigned other_len = other.storage_.length_;
2424 unsigned min_len = std::min(this_len, other_len);
2425 int comp = memcmp(this->cstr_, other.cstr_, min_len);
2426 if (comp < 0) return true;
2427 if (comp > 0) return false;
2428 return (this_len < other_len);
2429}
2430
2431bool Value::CZString::operator==(const CZString& other) const {
2432 if (!cstr_) return index_ == other.index_;

Callers

nothing calls this directly

Calls 3

decodePrefixedStringFunction · 0.70
minFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected