Skip to content

Commit

Permalink
[truffle] Remove null checks for something that is never a null now
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Sep 24, 2018
1 parent 782330a commit d696271
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions src/vm/jvm/runtime/org/perl6/nqp/truffle/NQPScopeWithFrame.java
Expand Up @@ -92,11 +92,7 @@ public FoundLexical findLexical(String name, int depth) {
FrameSlot found = frameDescriptor.findFrameSlot(name);

if (found == null) {
if (outer != null) {
return outer.findLexical(name, depth + 1);
} else {
throw new RuntimeException("Can't find lexical: " + name);
}
return outer.findLexical(name, depth + 1);
}
return new FoundLexical(found, depth);
}
Expand Down Expand Up @@ -128,38 +124,22 @@ public FrameSlot getContextSlot() {

@Override
public HLL getCurrentHLL() {
if (outer != null) {
return outer.getCurrentHLL();
} else {
throw new RuntimeException("Can't get current HLL");
}
return outer.getCurrentHLL();
}

@Override
public GlobalContext getGlobalContext() {
if (outer != null) {
return outer.getGlobalContext();
} else {
throw new RuntimeException("Can't get HLLs");
}
return outer.getGlobalContext();
}

@Override
public NQPCodeRef getCuid(String cuid) {
if (outer != null) {
return outer.getCuid(cuid);
} else {
throw new RuntimeException("Can't get cuid");
}
return outer.getCuid(cuid);
}

@Override
public void addCuid(String cuid, NQPCodeRef codeRef) {
if (outer != null) {
outer.addCuid(cuid, codeRef);
} else {
throw new RuntimeException("Can't add cuid");
}
outer.addCuid(cuid, codeRef);
}
}

0 comments on commit d696271

Please sign in to comment.