| 308 | #endif |
| 309 | |
| 310 | bool Value::CZString::operator<(const CZString& other) const { |
| 311 | if (!cstr_) return index_ < other.index_; |
| 312 | //return strcmp(cstr_, other.cstr_) < 0; |
| 313 | // Assume both are strings. |
| 314 | unsigned this_len = this->storage_.length_; |
| 315 | unsigned other_len = other.storage_.length_; |
| 316 | unsigned min_len = std::min<unsigned>(this_len, other_len); |
| 317 | JSON_ASSERT(this->cstr_ && other.cstr_); |
| 318 | int comp = memcmp(this->cstr_, other.cstr_, min_len); |
| 319 | if (comp < 0) return true; |
| 320 | if (comp > 0) return false; |
| 321 | return (this_len < other_len); |
| 322 | } |
| 323 | |
| 324 | bool Value::CZString::operator==(const CZString& other) const { |
| 325 | if (!cstr_) return index_ == other.index_; |
nothing calls this directly
no test coverage detected