MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / Next2

Method Next2

common/legacy_value.cc:207–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205 }
206
207 absl::StatusOr<bool> Next2(
208 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
209 google::protobuf::MessageFactory* absl_nonnull message_factory,
210 google::protobuf::Arena* absl_nonnull arena, Value* absl_nonnull key,
211 Value* absl_nullable value) override {
212 ABSL_DCHECK(descriptor_pool != nullptr);
213 ABSL_DCHECK(message_factory != nullptr);
214 ABSL_DCHECK(arena != nullptr);
215 ABSL_DCHECK(key != nullptr);
216
217 if (index_ >= size_) {
218 return false;
219 }
220 CEL_RETURN_IF_ERROR(ProjectKeys(arena));
221 auto cel_key = (*cel_list_)->Get(arena, index_);
222 if (value != nullptr) {
223 auto cel_value = cel_map_->Get(arena, cel_key);
224 if (!cel_value) {
225 return absl::DataLossError(
226 "map iterator returned key that was not present in the map");
227 }
228 CEL_RETURN_IF_ERROR(ModernValue(arena, *cel_value, *value));
229 }
230 CEL_RETURN_IF_ERROR(ModernValue(arena, cel_key, *key));
231 ++index_;
232 return true;
233 }
234
235 private:
236 absl::Status ProjectKeys(google::protobuf::Arena* arena) {

Callers

nothing calls this directly

Calls 2

ModernValueFunction · 0.70
GetMethod · 0.45

Tested by

no test coverage detected