| 527 | } |
| 528 | |
| 529 | absl::Status LegacyListValue::ForEach( |
| 530 | ForEachWithIndexCallback callback, |
| 531 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 532 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 533 | google::protobuf::Arena* absl_nonnull arena) const { |
| 534 | const auto size = impl_->size(); |
| 535 | Value element; |
| 536 | for (int index = 0; index < size; ++index) { |
| 537 | CEL_RETURN_IF_ERROR(ModernValue(arena, impl_->Get(arena, index), element)); |
| 538 | CEL_ASSIGN_OR_RETURN(auto ok, callback(index, Value(element))); |
| 539 | if (!ok) { |
| 540 | break; |
| 541 | } |
| 542 | } |
| 543 | return absl::OkStatus(); |
| 544 | } |
| 545 | |
| 546 | absl::StatusOr<absl_nonnull ValueIteratorPtr> LegacyListValue::NewIterator() |
| 547 | const { |