| 329 | #endif |
| 330 | |
| 331 | bool Value::CZString::operator<(const CZString& other) const { |
| 332 | if (!cstr_) |
| 333 | return index_ < other.index_; |
| 334 | // return strcmp(cstr_, other.cstr_) < 0; |
| 335 | // Assume both are strings. |
| 336 | unsigned this_len = this->storage_.length_; |
| 337 | unsigned other_len = other.storage_.length_; |
| 338 | unsigned min_len = std::min<unsigned>(this_len, other_len); |
| 339 | JSON_ASSERT(this->cstr_ && other.cstr_); |
| 340 | int comp = memcmp(this->cstr_, other.cstr_, min_len); |
| 341 | if (comp < 0) |
| 342 | return true; |
| 343 | if (comp > 0) |
| 344 | return false; |
| 345 | return (this_len < other_len); |
| 346 | } |
| 347 | |
| 348 | bool Value::CZString::operator==(const CZString& other) const { |
| 349 | if (!cstr_) |
nothing calls this directly
no test coverage detected