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

Method Contains

common/values/custom_list_value.cc:326–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326absl::Status CustomListValueInterface::Contains(
327 const Value& other,
328 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
329 google::protobuf::MessageFactory* absl_nonnull message_factory,
330 google::protobuf::Arena* absl_nonnull arena, Value* absl_nonnull result) const {
331 Value outcome = BoolValue(false);
332 Value equal;
333 CEL_RETURN_IF_ERROR(ForEach(
334 [&](size_t index, const Value& element) -> absl::StatusOr<bool> {
335 CEL_RETURN_IF_ERROR(element.Equal(other, descriptor_pool,
336 message_factory, arena, &equal));
337 if (auto bool_result = As<BoolValue>(equal);
338 bool_result.has_value() && bool_result->NativeValue()) {
339 outcome = BoolValue(true);
340 return false;
341 }
342 return true;
343 },
344 descriptor_pool, message_factory, arena));
345 *result = outcome;
346 return absl::OkStatus();
347}
348
349CustomListValue::CustomListValue() {
350 content_ = CustomListValueContent::From(CustomListValueInterface::Content{

Callers

nothing calls this directly

Calls 4

BoolValueClass · 0.70
EqualMethod · 0.45
has_valueMethod · 0.45
NativeValueMethod · 0.45

Tested by

no test coverage detected