| 2787 | } |
| 2788 | |
| 2789 | bool Value::CZString::operator==(const CZString& other) const { |
| 2790 | if (!cstr_) |
| 2791 | return index_ == other.index_; |
| 2792 | // return strcmp(cstr_, other.cstr_) == 0; |
| 2793 | // Assume both are strings. |
| 2794 | unsigned this_len = this->storage_.length_; |
| 2795 | unsigned other_len = other.storage_.length_; |
| 2796 | if (this_len != other_len) |
| 2797 | return false; |
| 2798 | JSON_ASSERT(this->cstr_ && other.cstr_); |
| 2799 | int comp = memcmp(this->cstr_, other.cstr_, this_len); |
| 2800 | return comp == 0; |
| 2801 | } |
| 2802 | |
| 2803 | ArrayIndex Value::CZString::index() const { return index_; } |
| 2804 |
nothing calls this directly
no test coverage detected