MCPcopy Create free account
hub / github.com/Kitware/CMake / operator<

Method operator<

Utilities/cmjsoncpp/src/lib_json/json_value.cpp:295–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293}
294
295bool Value::CZString::operator<(const CZString& other) const {
296 if (!cstr_)
297 return index_ < other.index_;
298 // return strcmp(cstr_, other.cstr_) < 0;
299 // Assume both are strings.
300 unsigned this_len = this->storage_.length_;
301 unsigned other_len = other.storage_.length_;
302 unsigned min_len = std::min<unsigned>(this_len, other_len);
303 JSON_ASSERT(this->cstr_ && other.cstr_);
304 int comp = memcmp(this->cstr_, other.cstr_, min_len);
305 if (comp < 0)
306 return true;
307 if (comp > 0)
308 return false;
309 return (this_len < other_len);
310}
311
312bool Value::CZString::operator==(const CZString& other) const {
313 if (!cstr_)

Callers

nothing calls this directly

Calls 4

decodePrefixedStringFunction · 0.85
typeClass · 0.50
typeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected