| 139 | } |
| 140 | |
| 141 | Status KeyValueMetadata::Set(std::string key, std::string value) { |
| 142 | auto index = FindKey(key); |
| 143 | if (index < 0) { |
| 144 | Append(std::move(key), std::move(value)); |
| 145 | } else { |
| 146 | keys_[index] = std::move(key); |
| 147 | values_[index] = std::move(value); |
| 148 | } |
| 149 | return Status::OK(); |
| 150 | } |
| 151 | |
| 152 | bool KeyValueMetadata::Contains(std::string_view key) const { return FindKey(key) >= 0; } |
| 153 |