MCPcopy Create free account
hub / github.com/Samsung/ONE / operator<

Method operator<

runtime/3rdparty/jsoncpp/jsoncpp.cpp:2944–2960  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2942}
2943
2944bool Value::CZString::operator<(const CZString &other) const
2945{
2946 if (!cstr_)
2947 return index_ < other.index_;
2948 // return strcmp(cstr_, other.cstr_) < 0;
2949 // Assume both are strings.
2950 unsigned this_len = this->storage_.length_;
2951 unsigned other_len = other.storage_.length_;
2952 unsigned min_len = std::min<unsigned>(this_len, other_len);
2953 JSON_ASSERT(this->cstr_ && other.cstr_);
2954 int comp = memcmp(this->cstr_, other.cstr_, min_len);
2955 if (comp < 0)
2956 return true;
2957 if (comp > 0)
2958 return false;
2959 return (this_len < other_len);
2960}
2961
2962bool Value::CZString::operator==(const CZString &other) const
2963{

Callers

nothing calls this directly

Calls 4

decodePrefixedStringFunction · 0.85
typeFunction · 0.50
typeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected