| 328 | } |
| 329 | |
| 330 | absl::Status ParsedRepeatedFieldValue::Contains( |
| 331 | const Value& other, |
| 332 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 333 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 334 | google::protobuf::Arena* absl_nonnull arena, Value* absl_nonnull result) const { |
| 335 | ABSL_DCHECK(*this); |
| 336 | if (ABSL_PREDICT_FALSE(field_ == nullptr)) { |
| 337 | *result = FalseValue(); |
| 338 | return absl::OkStatus(); |
| 339 | } |
| 340 | const auto* reflection = message_->GetReflection(); |
| 341 | const int size = reflection->FieldSize(*message_, field_); |
| 342 | if (size > 0) { |
| 343 | CEL_ASSIGN_OR_RETURN(auto accessor, |
| 344 | common_internal::RepeatedFieldAccessorFor(field_)); |
| 345 | Value scratch; |
| 346 | for (int i = 0; i < size; ++i) { |
| 347 | (*accessor)(i, message_, field_, reflection, descriptor_pool, |
| 348 | message_factory, arena, &scratch); |
| 349 | CEL_RETURN_IF_ERROR(scratch.Equal(other, descriptor_pool, message_factory, |
| 350 | arena, result)); |
| 351 | if (result->IsTrue()) { |
| 352 | return absl::OkStatus(); |
| 353 | } |
| 354 | } |
| 355 | } |
| 356 | *result = FalseValue(); |
| 357 | return absl::OkStatus(); |
| 358 | } |
| 359 | |
| 360 | const google::protobuf::Reflection* absl_nonnull ParsedRepeatedFieldValue::GetReflection() |
| 361 | const { |
nothing calls this directly
no test coverage detected