| 2942 | } |
| 2943 | |
| 2944 | bool Value::CZString::operator<(const CZString &other) const |
| 2945 | { |
| 2946 | if (!cstr_) |
| 2947 | return index_ < other.index_; |
| 2948 | // return strcmp(cstr_, other.cstr_) < 0; |
| 2949 | // Assume both are strings. |
| 2950 | unsigned this_len = this->storage_.length_; |
| 2951 | unsigned other_len = other.storage_.length_; |
| 2952 | unsigned min_len = std::min<unsigned>(this_len, other_len); |
| 2953 | JSON_ASSERT(this->cstr_ && other.cstr_); |
| 2954 | int comp = memcmp(this->cstr_, other.cstr_, min_len); |
| 2955 | if (comp < 0) |
| 2956 | return true; |
| 2957 | if (comp > 0) |
| 2958 | return false; |
| 2959 | return (this_len < other_len); |
| 2960 | } |
| 2961 | |
| 2962 | bool Value::CZString::operator==(const CZString &other) const |
| 2963 | { |
nothing calls this directly
no test coverage detected