| 2416 | } |
| 2417 | |
| 2418 | bool Value::CZString::operator<(const CZString& other) const { |
| 2419 | if (!cstr_) return index_ < other.index_; |
| 2420 | // return strcmp(cstr_, other.cstr_) < 0; |
| 2421 | // Assume both are strings. |
| 2422 | unsigned this_len = this->storage_.length_; |
| 2423 | unsigned other_len = other.storage_.length_; |
| 2424 | unsigned min_len = std::min(this_len, other_len); |
| 2425 | int comp = memcmp(this->cstr_, other.cstr_, min_len); |
| 2426 | if (comp < 0) return true; |
| 2427 | if (comp > 0) return false; |
| 2428 | return (this_len < other_len); |
| 2429 | } |
| 2430 | |
| 2431 | bool Value::CZString::operator==(const CZString& other) const { |
| 2432 | if (!cstr_) return index_ == other.index_; |
nothing calls this directly
no test coverage detected