Skip to content

Commit fc580d7

Browse files
committed
Remove redundant null check in NodeVisitor
A `ConditionalExpression`, differing from an `IfStatement`, always has an `else` case.
1 parent 4d1fe9b commit fc580d7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/net/starlark/java/syntax/NodeVisitor.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,7 @@ public void visit(@SuppressWarnings("unused") Comment node) {}
174174
public void visit(ConditionalExpression node) {
175175
visit(node.getCondition());
176176
visit(node.getThenCase());
177-
if (node.getElseCase() != null) {
178-
visit(node.getElseCase());
179-
}
177+
visit(node.getElseCase());
180178
}
181179

182180
// methods dealing with sequences of nodes

0 commit comments

Comments
 (0)