| 2731 | } |
| 2732 | |
| 2733 | bool 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 | |
| 2750 | bool Value::CZString::operator==(const CZString& other) const { |
| 2751 | if (!cstr_) |
nothing calls this directly
no test coverage detected