@@ -4587,29 +4587,25 @@ public RubyArray zipObjectObject(RubyArray array, Object[] others) {
4587
4587
4588
4588
@ Specialization (guards = {"!isOtherSingleObjectArray" })
4589
4589
public Object zipObjectObjectNotSingleObject (VirtualFrame frame , RubyArray array , Object [] others ) {
4590
- RubyBasicObject proc = RubyArguments .getBlock (frame .getArguments ());
4591
- if (proc == null ) {
4592
- proc = nil ();
4593
- }
4594
- return ruby (frame , "zip_internal(nil, *others)" , "others" , new RubyArray (getContext ().getCoreLibrary ().getArrayClass (), others , others .length ), "block" , proc );
4590
+ return zipRuby (frame , others );
4595
4591
}
4596
4592
4597
4593
@ Specialization (guards = {"!isOtherSingleIntegerFixnumArray" })
4598
4594
public Object zipObjectObjectNotSingleInteger (VirtualFrame frame , RubyArray array , Object [] others ) {
4599
- RubyBasicObject proc = RubyArguments .getBlock (frame .getArguments ());
4600
- if (proc == null ) {
4601
- proc = nil ();
4602
- }
4603
- return ruby (frame , "zip_internal(block, *others)" , "others" , new RubyArray (getContext ().getCoreLibrary ().getArrayClass (), others , others .length ), "block" , proc );
4595
+ return zipRuby (frame , others );
4604
4596
}
4605
4597
4606
4598
@ Specialization (guards = {"!isObject" })
4607
4599
public Object zipObjectObjectNotObject (VirtualFrame frame , RubyArray array , Object [] others ) {
4600
+ return zipRuby (frame , others );
4601
+ }
4602
+
4603
+ private Object zipRuby (VirtualFrame frame , Object [] others ) {
4608
4604
RubyBasicObject proc = RubyArguments .getBlock (frame .getArguments ());
4609
4605
if (proc == null ) {
4610
4606
proc = nil ();
4611
4607
}
4612
- return ruby (frame , "zip_internal(block, *others)" , "others" , new RubyArray (getContext ().getCoreLibrary ().getArrayClass (), others , others .length ), "block" , proc );
4608
+ return ruby (frame , "zip_internal(*others, &block )" , "others" , new RubyArray (getContext ().getCoreLibrary ().getArrayClass (), others , others .length ), "block" , proc );
4613
4609
}
4614
4610
4615
4611
}
0 commit comments