Refactoring: invert if

This commit is contained in:
Nikolay Krasko
2016-07-11 19:04:31 +03:00
parent ee2c5c1b73
commit ce74d6c7df
@@ -1366,7 +1366,10 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
) { ) {
assert expression instanceof KtContinueExpression || expression instanceof KtBreakExpression; assert expression instanceof KtContinueExpression || expression instanceof KtBreakExpression;
if (!blockStackElements.isEmpty()) { if (blockStackElements.isEmpty()) {
throw new UnsupportedOperationException("Target label for break/continue not found");
}
BlockStackElement stackElement = blockStackElements.peek(); BlockStackElement stackElement = blockStackElements.peek();
if (stackElement instanceof FinallyBlockStackElement) { if (stackElement instanceof FinallyBlockStackElement) {
@@ -1403,9 +1406,6 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
return result; return result;
} }
throw new UnsupportedOperationException("Target label for break/continue not found");
}
private StackValue generateSingleBranchIf( private StackValue generateSingleBranchIf(
final StackValue condition, final StackValue condition,
final KtIfExpression ifExpression, final KtIfExpression ifExpression,