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