| 2767 | #endif |
| 2768 | |
| 2769 | bool Value::CZString::operator<(const CZString& other) const { |
| 2770 | if (!cstr_) |
| 2771 | return index_ < other.index_; |
| 2772 | // return strcmp(cstr_, other.cstr_) < 0; |
| 2773 | // Assume both are strings. |
| 2774 | unsigned this_len = this->storage_.length_; |
| 2775 | unsigned other_len = other.storage_.length_; |
| 2776 | unsigned min_len = std::min<unsigned>(this_len, other_len); |
| 2777 | JSON_ASSERT(this->cstr_ && other.cstr_); |
| 2778 | int comp = memcmp(this->cstr_, other.cstr_, min_len); |
| 2779 | if (comp < 0) |
| 2780 | return true; |
| 2781 | if (comp > 0) |
| 2782 | return false; |
| 2783 | return (this_len < other_len); |
| 2784 | } |
| 2785 | |
| 2786 | bool Value::CZString::operator==(const CZString& other) const { |
| 2787 | if (!cstr_) |
nothing calls this directly
no test coverage detected