@@ -92,11 +92,7 @@ public FoundLexical findLexical(String name, int depth) {
92
92
FrameSlot found = frameDescriptor .findFrameSlot (name );
93
93
94
94
if (found == null ) {
95
- if (outer != null ) {
96
- return outer .findLexical (name , depth + 1 );
97
- } else {
98
- throw new RuntimeException ("Can't find lexical: " + name );
99
- }
95
+ return outer .findLexical (name , depth + 1 );
100
96
}
101
97
return new FoundLexical (found , depth );
102
98
}
@@ -128,38 +124,22 @@ public FrameSlot getContextSlot() {
128
124
129
125
@ Override
130
126
public HLL getCurrentHLL () {
131
- if (outer != null ) {
132
- return outer .getCurrentHLL ();
133
- } else {
134
- throw new RuntimeException ("Can't get current HLL" );
135
- }
127
+ return outer .getCurrentHLL ();
136
128
}
137
129
138
130
@ Override
139
131
public GlobalContext getGlobalContext () {
140
- if (outer != null ) {
141
- return outer .getGlobalContext ();
142
- } else {
143
- throw new RuntimeException ("Can't get HLLs" );
144
- }
132
+ return outer .getGlobalContext ();
145
133
}
146
134
147
135
@ Override
148
136
public NQPCodeRef getCuid (String cuid ) {
149
- if (outer != null ) {
150
- return outer .getCuid (cuid );
151
- } else {
152
- throw new RuntimeException ("Can't get cuid" );
153
- }
137
+ return outer .getCuid (cuid );
154
138
}
155
139
156
140
@ Override
157
141
public void addCuid (String cuid , NQPCodeRef codeRef ) {
158
- if (outer != null ) {
159
- outer .addCuid (cuid , codeRef );
160
- } else {
161
- throw new RuntimeException ("Can't add cuid" );
162
- }
142
+ outer .addCuid (cuid , codeRef );
163
143
}
164
144
}
165
145
0 commit comments