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

Method ApplySelect

extensions/select_optimization.cc:630–658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

628}
629
630absl::StatusOr<Value> OptimizedSelectImpl::ApplySelect(
631 ExecutionFrameBase& frame, const StructValue& struct_value) const {
632 auto value_or =
633 (options_.force_fallback_implementation)
634 ? absl::UnimplementedError("Forced fallback impl")
635 : struct_value.Qualify(select_path_, presence_test_,
636 frame.descriptor_pool(),
637 frame.message_factory(), frame.arena());
638
639 if (!value_or.ok()) {
640 if (value_or.status().code() == absl::StatusCode::kUnimplemented) {
641 return FallbackSelect(struct_value, select_path_, presence_test_,
642 frame.descriptor_pool(), frame.message_factory(),
643 frame.arena());
644 }
645
646 return value_or.status();
647 }
648
649 if (value_or->second < 0 || value_or->second >= select_path_.size()) {
650 return std::move(value_or->first);
651 }
652
653 return FallbackSelect(
654 value_or->first,
655 absl::MakeConstSpan(select_path_).subspan(value_or->second),
656 presence_test_, frame.descriptor_pool(), frame.message_factory(),
657 frame.arena());
658}
659
660AttributeTrail OptimizedSelectImpl::GetAttributeTrail(
661 const AttributeTrail& operand_trail) const {

Callers 1

EvaluateMethod · 0.80

Calls 8

FallbackSelectFunction · 0.85
codeMethod · 0.80
QualifyMethod · 0.45
descriptor_poolMethod · 0.45
message_factoryMethod · 0.45
arenaMethod · 0.45
okMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected