MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / operator<

Method operator<

src/share/jsoncpp/jsoncpp.cpp:2748–2760  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2746}
2747
2748bool Value::CZString::operator<(const CZString& other) const {
2749 if (!cstr_) return index_ < other.index_;
2750 //return strcmp(cstr_, other.cstr_) < 0;
2751 // Assume both are strings.
2752 unsigned this_len = this->storage_.length_;
2753 unsigned other_len = other.storage_.length_;
2754 unsigned min_len = std::min<unsigned>(this_len, other_len);
2755 JSON_ASSERT(this->cstr_ && other.cstr_);
2756 int comp = memcmp(this->cstr_, other.cstr_, min_len);
2757 if (comp < 0) return true;
2758 if (comp > 0) return false;
2759 return (this_len < other_len);
2760}
2761
2762bool Value::CZString::operator==(const CZString& other) const {
2763 if (!cstr_) return index_ == other.index_;

Callers

nothing calls this directly

Calls 2

decodePrefixedStringFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected