Skip to content

Commit

Permalink
fix exitwhen rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Frotty committed May 25, 2018
1 parent 2e3955c commit c3b8bf6
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ private void optimizeElement(Element elem) {
}

private void optimizeConsecutiveExitWhen(ImExitwhen lookback, ImExitwhen element) {
lookback.getCondition().setParent(null);
element.getCondition().setParent(null);
lookback.getCondition().replaceBy(JassIm.ImOperatorCall(WurstOperator.OR, JassIm.ImExprs(lookback.getCondition(), element.getCondition())));
lookback.setCondition(JassIm.ImOperatorCall(WurstOperator.OR, JassIm.ImExprs(lookback.getCondition().copy(), element.getCondition())));
element.replaceBy(JassIm.ImNull());
totalRewrites++;
}
Expand Down

0 comments on commit c3b8bf6

Please sign in to comment.