From d696271314b8a145cef68040dc26abed225b5198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Murias?= Date: Mon, 24 Sep 2018 21:17:18 +0200 Subject: [PATCH] [truffle] Remove null checks for something that is never a null now --- .../perl6/nqp/truffle/NQPScopeWithFrame.java | 30 ++++--------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/src/vm/jvm/runtime/org/perl6/nqp/truffle/NQPScopeWithFrame.java b/src/vm/jvm/runtime/org/perl6/nqp/truffle/NQPScopeWithFrame.java index 2610d8ae5b..a58784ab78 100644 --- a/src/vm/jvm/runtime/org/perl6/nqp/truffle/NQPScopeWithFrame.java +++ b/src/vm/jvm/runtime/org/perl6/nqp/truffle/NQPScopeWithFrame.java @@ -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); } @@ -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); } }