Skip to content

Commit

Permalink
Off by one error in proc to interface optimization for 2 and 3 arity …
Browse files Browse the repository at this point in the history
…paths (still missing test)
  • Loading branch information
enebo committed Jul 7, 2015
1 parent e5955c8 commit a741a82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/javasupport/Java.java
Expand Up @@ -1150,8 +1150,8 @@ public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule claz
final IRubyObject[] newArgs;
switch( args.length ) {
case 1 : newArgs = IRubyObject.NULL_ARRAY; break;
case 2 : newArgs = new IRubyObject[] { args[0] }; break;
case 3 : newArgs = new IRubyObject[] { args[0], args[1] }; break;
case 2 : newArgs = new IRubyObject[] { args[1] }; break;
case 3 : newArgs = new IRubyObject[] { args[1], args[2] }; break;
default : newArgs = new IRubyObject[ args.length - 1 ];
System.arraycopy(args, 1, newArgs, 0, newArgs.length);
}
Expand Down

1 comment on commit a741a82

@kares
Copy link
Member

@kares kares commented on a741a82 Jul 15, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad, added some specs (kind of assumed this is covered) c79610c and 1d90f9f

Please sign in to comment.