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

Method Get

common/values/value_builder.cc:1054–1066  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1052
1053 using CompatMapValue::Get;
1054 absl::optional<CelValue> Get(google::protobuf::Arena* arena,
1055 CelValue key) const override {
1056 if (auto status = CelValue::CheckMapKeyType(key); !status.ok()) {
1057 status.IgnoreError();
1058 return absl::nullopt;
1059 }
1060 if (auto it = map_.find(key); it != map_.end()) {
1061 return common_internal::UnsafeLegacyValue(
1062 it->second, /*stable=*/true,
1063 arena != nullptr ? arena : map_.get_allocator().arena());
1064 }
1065 return absl::nullopt;
1066 }
1067
1068 absl::StatusOr<bool> Has(const CelValue& key) const override {
1069 // 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