| 2681 | } |
| 2682 | |
| 2683 | bool Value::CZString::operator<(const CZString &other) const { |
| 2684 | if (!cstr_) |
| 2685 | return index_ < other.index_; |
| 2686 | // return strcmp(cstr_, other.cstr_) < 0; |
| 2687 | // Assume both are strings. |
| 2688 | unsigned this_len = this->storage_.length_; |
| 2689 | unsigned other_len = other.storage_.length_; |
| 2690 | unsigned min_len = std::min<unsigned>(this_len, other_len); |
| 2691 | JSON_ASSERT(this->cstr_ && other.cstr_); |
| 2692 | int comp = memcmp(this->cstr_, other.cstr_, min_len); |
| 2693 | if (comp < 0) |
| 2694 | return true; |
| 2695 | if (comp > 0) |
| 2696 | return false; |
| 2697 | return (this_len < other_len); |
| 2698 | } |
| 2699 | |
| 2700 | bool Value::CZString::operator==(const CZString &other) const { |
| 2701 | if (!cstr_) |
nothing calls this directly
no test coverage detected