| 2746 | } |
| 2747 | |
| 2748 | bool Value::CZString::operator<(const CZString& other) const { |
| 2749 | if (!cstr_) return index_ < other.index_; |
| 2750 | //return strcmp(cstr_, other.cstr_) < 0; |
| 2751 | // Assume both are strings. |
| 2752 | unsigned this_len = this->storage_.length_; |
| 2753 | unsigned other_len = other.storage_.length_; |
| 2754 | unsigned min_len = std::min<unsigned>(this_len, other_len); |
| 2755 | JSON_ASSERT(this->cstr_ && other.cstr_); |
| 2756 | int comp = memcmp(this->cstr_, other.cstr_, min_len); |
| 2757 | if (comp < 0) return true; |
| 2758 | if (comp > 0) return false; |
| 2759 | return (this_len < other_len); |
| 2760 | } |
| 2761 | |
| 2762 | bool Value::CZString::operator==(const CZString& other) const { |
| 2763 | if (!cstr_) return index_ == other.index_; |
nothing calls this directly
no test coverage detected