MCPcopy Create free account
hub / github.com/PlayFab/gsdk / operator<

Method operator<

cpp/cppsdk/jsoncpp.cpp:2769–2784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2767#endif
2768
2769bool Value::CZString::operator<(const CZString& other) const {
2770 if (!cstr_)
2771 return index_ < other.index_;
2772 // return strcmp(cstr_, other.cstr_) < 0;
2773 // Assume both are strings.
2774 unsigned this_len = this->storage_.length_;
2775 unsigned other_len = other.storage_.length_;
2776 unsigned min_len = std::min<unsigned>(this_len, other_len);
2777 JSON_ASSERT(this->cstr_ && other.cstr_);
2778 int comp = memcmp(this->cstr_, other.cstr_, min_len);
2779 if (comp < 0)
2780 return true;
2781 if (comp > 0)
2782 return false;
2783 return (this_len < other_len);
2784}
2785
2786bool Value::CZString::operator==(const CZString& other) const {
2787 if (!cstr_)

Callers

nothing calls this directly

Calls 2

decodePrefixedStringFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected