| 206 | } |
| 207 | |
| 208 | absl::Status ParsedRepeatedFieldValue::ForEach( |
| 209 | ForEachWithIndexCallback callback, |
| 210 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 211 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 212 | google::protobuf::Arena* absl_nonnull arena) const { |
| 213 | ABSL_DCHECK(*this); |
| 214 | if (ABSL_PREDICT_FALSE(field_ == nullptr)) { |
| 215 | return absl::OkStatus(); |
| 216 | } |
| 217 | const auto* reflection = message_->GetReflection(); |
| 218 | const int size = reflection->FieldSize(*message_, field_); |
| 219 | if (size > 0) { |
| 220 | CEL_ASSIGN_OR_RETURN(auto accessor, |
| 221 | common_internal::RepeatedFieldAccessorFor(field_)); |
| 222 | Value scratch; |
| 223 | for (int i = 0; i < size; ++i) { |
| 224 | (*accessor)(i, message_, field_, reflection, descriptor_pool, |
| 225 | message_factory, arena, &scratch); |
| 226 | CEL_ASSIGN_OR_RETURN(auto ok, callback(static_cast<size_t>(i), scratch)); |
| 227 | if (!ok) { |
| 228 | break; |
| 229 | } |
| 230 | } |
| 231 | } |
| 232 | return absl::OkStatus(); |
| 233 | } |
| 234 | |
| 235 | namespace { |
| 236 |
nothing calls this directly
no test coverage detected