| 2777 | #endif |
| 2778 | |
| 2779 | bool Value::CZString::operator<(const CZString& other) const { |
| 2780 | if (!cstr_) return index_ < other.index_; |
| 2781 | //return strcmp(cstr_, other.cstr_) < 0; |
| 2782 | // Assume both are strings. |
| 2783 | unsigned this_len = this->storage_.length_; |
| 2784 | unsigned other_len = other.storage_.length_; |
| 2785 | unsigned min_len = std::min<unsigned>(this_len, other_len); |
| 2786 | JSON_ASSERT(this->cstr_ && other.cstr_); |
| 2787 | int comp = memcmp(this->cstr_, other.cstr_, min_len); |
| 2788 | if (comp < 0) return true; |
| 2789 | if (comp > 0) return false; |
| 2790 | return (this_len < other_len); |
| 2791 | } |
| 2792 | |
| 2793 | bool Value::CZString::operator==(const CZString& other) const { |
| 2794 | if (!cstr_) return index_ == other.index_; |
nothing calls this directly
no test coverage detected