Skip to content

Commit

Permalink
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/src/main/java/org/jruby/RubyArray.java
Original file line number Diff line number Diff line change
@@ -2524,10 +2524,10 @@ public IRubyObject selectCommon(ThreadContext context, Block block) {
IRubyObject value2 = eltOk(1);
boolean second = block.yield(context, value2).isTrue();
if (first) {
if (second) return new RubyArrayTwoObject(runtime, value, value2);
return new RubyArrayOneObject(runtime, value);
if (second) return newArray(runtime, value, value2);
return newArray(runtime, value);
} else if (second) {
return new RubyArrayOneObject(runtime, value2);
return newArray(runtime, value2);
}
return newEmptyArray(runtime);
}
@@ -3178,11 +3178,11 @@ public IRubyObject op_plus(IRubyObject obj) {
case 2:
switch (realLength) {
case 0:
return new RubyArrayTwoObject(runtime, y.eltInternal(0), y.eltInternal(1));
return newArray(runtime, y.eltInternal(0), y.eltInternal(1));
case 1:
return new RubyArrayTwoObject(runtime, eltInternal(0), y.eltInternal(0));
return newArray(runtime, eltInternal(0), y.eltInternal(0));
case 2:
return new RubyArrayTwoObject(runtime, eltInternal(0), eltInternal(1));
return newArray(runtime, eltInternal(0), eltInternal(1));
}
}

0 comments on commit 150c83d

Please sign in to comment.