Refactoring: invert if
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user