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