Dont evaluate right hand side of Logical Or if left hand is true.
This commit is contained in:
@@ -291,6 +291,10 @@ namespace Porygon::Evaluation {
|
||||
if (!leftValue->EvaluateBool())
|
||||
return new BooleanEvalValue(false);
|
||||
}
|
||||
else if (operation == BoundBinaryOperation::LogicalOr) {
|
||||
if (leftValue->EvaluateBool())
|
||||
return new BooleanEvalValue(true);
|
||||
}
|
||||
auto rightValue = this -> EvaluateExpression(expression->GetRight());
|
||||
if (operation == BoundBinaryOperation::Equality){
|
||||
return new BooleanEvalValue(leftValue->operator==(rightValue.Get()));
|
||||
|
||||
Reference in New Issue
Block a user