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

Method CheckListIndex

extensions/protobuf/internal/qualify.cc:288–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288absl::StatusOr<int> ProtoQualifyState::CheckListIndex(
289 const cel::AttributeQualifier& qualifier) const {
290 if (qualifier.kind() != cel::Kind::kInt64) {
291 return runtime_internal::CreateNoMatchingOverloadError(
292 cel::builtin::kIndex);
293 }
294
295 int index = *qualifier.GetInt64Key();
296 int size = reflection_->FieldSize(*message_, repeated_field_desc_);
297 if (index < 0 || index >= size) {
298 return absl::InvalidArgumentError(
299 absl::StrCat("index out of bounds: index=", index, " size=", size));
300 }
301 return index;
302}
303
304absl::Status ProtoQualifyState::ApplyAttributeQualifierList(
305 const cel::AttributeQualifier& qualifier, MemoryManagerRef memory_manager) {

Callers

nothing calls this directly

Calls 3

GetInt64KeyMethod · 0.80
kindMethod · 0.45

Tested by

no test coverage detected