Like `operator[](int)` above, but also accepts an arena. Prefer calling this variant if the arena is known.
| 304 | // Like `operator[](int)` above, but also accepts an arena. Prefer calling |
| 305 | // this variant if the arena is known. |
| 306 | CelValue Get(google::protobuf::Arena* arena, int index) const override { |
| 307 | if (arena == nullptr) { |
| 308 | arena = elements_.get_allocator().arena(); |
| 309 | } |
| 310 | if (ABSL_PREDICT_FALSE(index < 0 || index >= size())) { |
| 311 | return CelValue::CreateError(google::protobuf::Arena::Create<absl::Status>( |
| 312 | arena, IndexOutOfBoundsError(index).ToStatus())); |
| 313 | } |
| 314 | return common_internal::UnsafeLegacyValue( |
| 315 | elements_[index], |
| 316 | /*stable=*/true, |
| 317 | arena != nullptr ? arena : elements_.get_allocator().arena()); |
| 318 | } |
| 319 | |
| 320 | int size() const override { return static_cast<int>(Size()); } |
| 321 |
nothing calls this directly
no test coverage detected