| 2696 | } |
| 2697 | |
| 2698 | bool Value::CZString::operator<(const CZString& other) const { |
| 2699 | if (!cstr_) return index_ < other.index_; |
| 2700 | //return strcmp(cstr_, other.cstr_) < 0; |
| 2701 | // Assume both are strings. |
| 2702 | unsigned this_len = this->storage_.length_; |
| 2703 | unsigned other_len = other.storage_.length_; |
| 2704 | unsigned min_len = std::min(this_len, other_len); |
| 2705 | int comp = memcmp(this->cstr_, other.cstr_, min_len); |
| 2706 | if (comp < 0) return true; |
| 2707 | if (comp > 0) return false; |
| 2708 | return (this_len < other_len); |
| 2709 | } |
| 2710 | |
| 2711 | bool Value::CZString::operator==(const CZString& other) const { |
| 2712 | if (!cstr_) return index_ == other.index_; |
nothing calls this directly
no test coverage detected