Skip to content

Commit a741a82

Browse files
committed
Off by one error in proc to interface optimization for 2 and 3 arity paths (still missing test)
1 parent e5955c8 commit a741a82

File tree

1 file changed

+2
-2
lines changed
  • core/src/main/java/org/jruby/javasupport

1 file changed

+2
-2
lines changed

core/src/main/java/org/jruby/javasupport/Java.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,8 +1150,8 @@ public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule claz
11501150
final IRubyObject[] newArgs;
11511151
switch( args.length ) {
11521152
case 1 : newArgs = IRubyObject.NULL_ARRAY; break;
1153-
case 2 : newArgs = new IRubyObject[] { args[0] }; break;
1154-
case 3 : newArgs = new IRubyObject[] { args[0], args[1] }; break;
1153+
case 2 : newArgs = new IRubyObject[] { args[1] }; break;
1154+
case 3 : newArgs = new IRubyObject[] { args[1], args[2] }; break;
11551155
default : newArgs = new IRubyObject[ args.length - 1 ];
11561156
System.arraycopy(args, 1, newArgs, 0, newArgs.length);
11571157
}

0 commit comments

Comments
 (0)