MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / Get

Method Get

common/values/value_builder.cc:1218–1230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 5

CheckMapKeyTypeFunction · 0.85
UnsafeLegacyValueFunction · 0.85
okMethod · 0.45
endMethod · 0.45
arenaMethod · 0.45

Tested by

no test coverage detected