Skip to content

Commit

Permalink
Adapt evaluation of conditional expression to match the change of las…
Browse files Browse the repository at this point in the history
…t week

Following the change simplifying the conditional in <268c2dd>
  • Loading branch information
Viir committed Nov 29, 2024
1 parent ca7be01 commit 5a28051
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions implement/pine/Pine/PineVM/PineVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2378,21 +2378,17 @@ public PineValue EvaluateConditionalExpression(
environment,
stackPrevValues: stackPrevValues);

return
conditionValue == PineVMValues.TrueValue
?
EvaluateExpressionDefaultLessStack(
if (conditionValue == PineVMValues.TrueValue)
{
return EvaluateExpressionDefaultLessStack(
conditional.trueBranch,
environment,
stackPrevValues: stackPrevValues)
:
conditionValue == PineVMValues.FalseValue
?
EvaluateExpressionDefaultLessStack(
stackPrevValues: stackPrevValues);
}

return EvaluateExpressionDefaultLessStack(
conditional.falseBranch,
environment,
stackPrevValues: stackPrevValues)
:
PineValue.EmptyList;
stackPrevValues: stackPrevValues);
}
}

0 comments on commit 5a28051

Please sign in to comment.