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