Skip to content

Commit 1cfc0dd

Browse files
committed
simplify a little
1 parent 4801720 commit 1cfc0dd

File tree

1 file changed

+2
-6
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/statement

1 file changed

+2
-6
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/statement/TryExceptNode.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,23 +255,19 @@ protected static boolean test(TruffleObject receiver) {
255255

256256
protected static class CatchesFunction implements TruffleObject {
257257
private final RootCallTarget isInstance;
258-
private final PTuple caughtClasses;
259258
private final Object[] args = PArguments.create(2);
260259

261260
CatchesFunction(RootCallTarget callTarget, PTuple caughtClasses) {
262261
this.isInstance = callTarget;
263-
this.caughtClasses = caughtClasses;
262+
PArguments.setArgument(args, 1, caughtClasses);
264263
}
265264

266265
@ExplodeLoop
267266
boolean catches(Object exception) {
268267
if (exception instanceof PBaseException) {
269268
PArguments.setArgument(args, 0, exception);
270-
PArguments.setArgument(args, 1, caughtClasses);
271269
try {
272-
if (isInstance.call(args) == Boolean.TRUE) {
273-
return true;
274-
}
270+
return isInstance.call(args) == Boolean.TRUE;
275271
} catch (PException e) {
276272
}
277273
}

0 commit comments

Comments
 (0)