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

Method operator<

ThirdParty/jsoncpp/vtkjsoncpp/jsoncpp.cpp:2733–2748  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2731}
2732
2733bool Value::CZString::operator<(const CZString& other) const {
2734 if (!cstr_)
2735 return index_ < other.index_;
2736 // return strcmp(cstr_, other.cstr_) < 0;
2737 // Assume both are strings.
2738 unsigned this_len = this->storage_.length_;
2739 unsigned other_len = other.storage_.length_;
2740 unsigned min_len = std::min<unsigned>(this_len, other_len);
2741 JSON_ASSERT(this->cstr_ && other.cstr_);
2742 int comp = memcmp(this->cstr_, other.cstr_, min_len);
2743 if (comp < 0)
2744 return true;
2745 if (comp > 0)
2746 return false;
2747 return (this_len < other_len);
2748}
2749
2750bool Value::CZString::operator==(const CZString& other) const {
2751 if (!cstr_)

Callers

nothing calls this directly

Calls 4

decodePrefixedStringFunction · 0.85
typeEnum · 0.50
typeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected