Skip to content

Commit 96f7532

Browse files
committed
Minor, prettify code
1 parent 21a0ca5 commit 96f7532

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2619,36 +2619,38 @@ public StackValue visitDotQualifiedExpression(@NotNull JetDotQualifiedExpression
26192619
}
26202620

26212621
@Override
2622-
public StackValue visitSafeQualifiedExpression(@NotNull JetSafeQualifiedExpression expression, StackValue receiver) {
2623-
JetExpression expr = expression.getReceiverExpression();
2624-
Type receiverType = expressionType(expr);
2625-
gen(expr, receiverType);
2622+
public StackValue visitSafeQualifiedExpression(@NotNull JetSafeQualifiedExpression expression, StackValue unused) {
2623+
JetExpression receiver = expression.getReceiverExpression();
2624+
JetExpression selector = expression.getSelectorExpression();
2625+
Type receiverType = expressionType(receiver);
2626+
2627+
gen(receiver, receiverType);
2628+
26262629
if (isPrimitive(receiverType)) {
2627-
StackValue propValue = genQualified(StackValue.onStack(receiverType), expression.getSelectorExpression());
2630+
StackValue propValue = genQualified(StackValue.onStack(receiverType), selector);
26282631
Type type = boxType(propValue.type);
26292632
propValue.put(type, v);
26302633

26312634
return StackValue.onStack(type);
26322635
}
2633-
else {
2634-
Label ifnull = new Label();
2635-
Label end = new Label();
2636-
v.dup();
2637-
v.ifnull(ifnull);
2638-
StackValue propValue = genQualified(StackValue.onStack(receiverType), expression.getSelectorExpression());
2639-
Type type = boxType(propValue.type);
2640-
propValue.put(type, v);
2641-
v.goTo(end);
26422636

2643-
v.mark(ifnull);
2644-
v.pop();
2645-
if (!type.equals(Type.VOID_TYPE)) {
2646-
v.aconst(null);
2647-
}
2648-
v.mark(end);
2637+
Label ifnull = new Label();
2638+
Label end = new Label();
2639+
v.dup();
2640+
v.ifnull(ifnull);
2641+
StackValue propValue = genQualified(StackValue.onStack(receiverType), selector);
2642+
Type type = boxType(propValue.type);
2643+
propValue.put(type, v);
2644+
v.goTo(end);
26492645

2650-
return StackValue.onStack(type);
2646+
v.mark(ifnull);
2647+
v.pop();
2648+
if (!type.equals(Type.VOID_TYPE)) {
2649+
v.aconst(null);
26512650
}
2651+
v.mark(end);
2652+
2653+
return StackValue.onStack(type);
26522654
}
26532655

26542656
@Override

0 commit comments

Comments
 (0)