| 1216 | |
| 1217 | using MutableCompatMapValue::Get; |
| 1218 | absl::optional<CelValue> Get(google::protobuf::Arena* arena, |
| 1219 | CelValue key) const override { |
| 1220 | if (auto status = CelValue::CheckMapKeyType(key); !status.ok()) { |
| 1221 | status.IgnoreError(); |
| 1222 | return absl::nullopt; |
| 1223 | } |
| 1224 | if (auto it = map_.find(key); it != map_.end()) { |
| 1225 | return common_internal::UnsafeLegacyValue( |
| 1226 | it->second, /*stable=*/false, |
| 1227 | arena != nullptr ? arena : map_.get_allocator().arena()); |
| 1228 | } |
| 1229 | return absl::nullopt; |
| 1230 | } |
| 1231 | |
| 1232 | absl::StatusOr<bool> Has(const CelValue& key) const override { |
| 1233 | // This check safeguards against issues with invalid key types such as NaN. |
nothing calls this directly
no test coverage detected