MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / operator<

Method operator<

src/jsoncpp.cpp:2698–2709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2696}
2697
2698bool Value::CZString::operator<(const CZString& other) const {
2699 if (!cstr_) return index_ < other.index_;
2700 //return strcmp(cstr_, other.cstr_) < 0;
2701 // Assume both are strings.
2702 unsigned this_len = this->storage_.length_;
2703 unsigned other_len = other.storage_.length_;
2704 unsigned min_len = std::min(this_len, other_len);
2705 int comp = memcmp(this->cstr_, other.cstr_, min_len);
2706 if (comp < 0) return true;
2707 if (comp > 0) return false;
2708 return (this_len < other_len);
2709}
2710
2711bool Value::CZString::operator==(const CZString& other) const {
2712 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