Skip to content

Commit f116569

Browse files
committed
Revert "It appears getLexicalScopes can return null now."
This reverts commit ca14416.
1 parent ca14416 commit f116569

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

core/src/main/java/org/jruby/ir/persistence/IRWriter.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ public static void persist(IRWriterEncoder file, IRScope script) throws IOExcept
3434
private static void persistScopeInstructions(IRWriterEncoder file, IRScope parent) {
3535
persistScopeInstrs(file, parent);
3636

37-
if (parent.getLexicalScopes() != null) {
38-
for (IRScope scope: parent.getLexicalScopes()) {
39-
persistScopeInstructions(file, scope);
40-
}
37+
for (IRScope scope: parent.getLexicalScopes()) {
38+
persistScopeInstructions(file, scope);
4139
}
4240
}
4341

@@ -62,10 +60,8 @@ private static void persistScopeInstrs(IRWriterEncoder file, IRScope scope) {
6260
private static void persistScopeHeaders(IRWriterEncoder file, IRScope parent) {
6361
persistScopeHeader(file, parent);
6462

65-
if (parent.getLexicalScopes() != null) {
66-
for (IRScope scope : parent.getLexicalScopes()) {
67-
persistScopeHeaders(file, scope);
68-
}
63+
for (IRScope scope: parent.getLexicalScopes()) {
64+
persistScopeHeaders(file, scope);
6965
}
7066
}
7167

0 commit comments

Comments
 (0)