| 145 | } |
| 146 | |
| 147 | Status KeyValueMetadata::Set(std::string key, std::string value) { |
| 148 | auto index = FindKey(key); |
| 149 | if (index < 0) { |
| 150 | Append(std::move(key), std::move(value)); |
| 151 | } else { |
| 152 | keys_[index] = std::move(key); |
| 153 | values_[index] = std::move(value); |
| 154 | } |
| 155 | return Status::OK(); |
| 156 | } |
| 157 | |
| 158 | bool KeyValueMetadata::Contains(std::string_view key) const { return FindKey(key) >= 0; } |
| 159 |