| 61 | } |
| 62 | |
| 63 | absl::StatusOr<Value> SetsIntersects( |
| 64 | const ListValue& list, const ListValue& sublist, |
| 65 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 66 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 67 | google::protobuf::Arena* absl_nonnull arena) { |
| 68 | bool exists = false; |
| 69 | CEL_RETURN_IF_ERROR(list.ForEach( |
| 70 | [&](const Value& list_element) -> absl::StatusOr<bool> { |
| 71 | CEL_ASSIGN_OR_RETURN(auto contains, |
| 72 | sublist.Contains(list_element, descriptor_pool, |
| 73 | message_factory, arena)); |
| 74 | // Treat contains return CEL error as false for the sake of |
| 75 | // intersecting. |
| 76 | exists = contains->Is<BoolValue>() && contains.GetBool().NativeValue(); |
| 77 | return !exists; |
| 78 | }, |
| 79 | descriptor_pool, message_factory, arena)); |
| 80 | |
| 81 | return BoolValue(exists); |
| 82 | } |
| 83 | |
| 84 | absl::StatusOr<Value> SetsEquivalent( |
| 85 | const ListValue& list, const ListValue& sublist, |
nothing calls this directly
no test coverage detected