| 628 | } |
| 629 | |
| 630 | absl::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 | |
| 660 | AttributeTrail OptimizedSelectImpl::GetAttributeTrail( |
| 661 | const AttributeTrail& operand_trail) const { |
no test coverage detected