| 237 | } |
| 238 | |
| 239 | bool KeyValueMetadata::Equals(const KeyValueMetadata& other) const { |
| 240 | if (size() != other.size()) { |
| 241 | return false; |
| 242 | } |
| 243 | |
| 244 | auto indices = internal::ArgSort(keys_); |
| 245 | auto other_indices = internal::ArgSort(other.keys_); |
| 246 | |
| 247 | for (int64_t i = 0; i < size(); ++i) { |
| 248 | auto j = indices[i]; |
| 249 | auto k = other_indices[i]; |
| 250 | if (keys_[j] != other.keys_[k] || values_[j] != other.values_[k]) { |
| 251 | return false; |
| 252 | } |
| 253 | } |
| 254 | return true; |
| 255 | } |
| 256 | |
| 257 | std::string KeyValueMetadata::ToString() const { |
| 258 | std::stringstream buffer; |