@@ -603,7 +603,7 @@ absl::Status ComprehensionNextStep::Evaluate1(ExecutionFrame* frame) const {
603603 if (!iter_range->Is <cel::ListValue>()) {
604604 if (iter_range->Is <cel::ErrorValue>() ||
605605 iter_range->Is <cel::UnknownValue>()) {
606- frame->value_stack ().PopAndPush ( kStackSize , std::move (iter_range) );
606+ frame->value_stack ().SwapAndPop ( /* n= */ kStackSize , /* i= */ POS_ITER_RANGE );
607607 } else {
608608 frame->value_stack ().PopAndPush (
609609 kStackSize ,
@@ -689,7 +689,7 @@ absl::Status ComprehensionNextStep::Evaluate2(ExecutionFrame* frame) const {
689689 ABSL_FALLTHROUGH_INTENDED;
690690 case ValueKind::kUnknown :
691691 // Leave it on the stack.
692- frame->value_stack ().PopAndPush ( kStackSize , std::move (iter2_range) );
692+ frame->value_stack ().SwapAndPop ( /* n= */ kStackSize , /* i= */ POS_ITER2_RANGE );
693693 return frame->JumpTo (error_jump_offset_);
694694 default :
695695 frame->value_stack ().PopAndPush (
@@ -706,7 +706,7 @@ absl::Status ComprehensionNextStep::Evaluate2(ExecutionFrame* frame) const {
706706 case ValueKind::kError :
707707 ABSL_FALLTHROUGH_INTENDED;
708708 case ValueKind::kUnknown :
709- frame->value_stack ().PopAndPush ( kStackSize , std::move (iter_range) );
709+ frame->value_stack ().SwapAndPop ( /* n= */ kStackSize , /* i= */ POS_ITER_RANGE );
710710 return frame->JumpTo (error_jump_offset_);
711711 default :
712712 frame->value_stack ().PopAndPush (
@@ -834,7 +834,7 @@ absl::Status ComprehensionCondStep::Evaluate1(ExecutionFrame* frame) const {
834834 if (!loop_condition_value->Is <cel::BoolValue>()) {
835835 if (loop_condition_value->Is <cel::ErrorValue>() ||
836836 loop_condition_value->Is <cel::UnknownValue>()) {
837- frame->value_stack ().PopAndPush ( 3 , std::move (loop_condition_value) );
837+ frame->value_stack ().SwapAndPop ( /* n= */ 3 , /* i= */ 2 );
838838 } else {
839839 frame->value_stack ().PopAndPush (
840840 3 ,
@@ -872,7 +872,7 @@ absl::Status ComprehensionCondStep::Evaluate2(ExecutionFrame* frame) const {
872872 if (!loop_condition_value->Is <cel::BoolValue>()) {
873873 if (loop_condition_value->Is <cel::ErrorValue>() ||
874874 loop_condition_value->Is <cel::UnknownValue>()) {
875- frame->value_stack ().PopAndPush ( 4 , std::move (loop_condition_value) );
875+ frame->value_stack ().SwapAndPop ( /* n= */ 4 , /* i= */ 3 );
876876 } else {
877877 frame->value_stack ().PopAndPush (
878878 4 ,
0 commit comments