Skip to content

Commit

Permalink
Make Yard happy with 1/2 shaped array elements (work-around for collect)
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed Dec 13, 2016
1 parent 7dbb838 commit fd44e62
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
11 changes: 0 additions & 11 deletions core/src/main/java/org/jruby/specialized/RubyArrayOneObject.java
Expand Up @@ -83,17 +83,6 @@ public IRubyObject rb_clear() {
return this;
}

@Override
public IRubyObject collect(ThreadContext context, Block block) {
if (!packed()) return super.collect(context, block);

IRubyObject elt0 = block.yield(context, value);

if (!packed()) return collectFrom(context, arrayOf(elt0), 1, block);

return new RubyArrayOneObject(getRuntime(), elt0);
}

@Override
public void copyInto(IRubyObject[] target, int start) {
if (!packed()) {
Expand Down
15 changes: 0 additions & 15 deletions core/src/main/java/org/jruby/specialized/RubyArrayTwoObject.java
Expand Up @@ -92,21 +92,6 @@ public IRubyObject rb_clear() {
return this;
}

@Override
public IRubyObject collect(ThreadContext context, Block block) {
if (!packed()) return super.collect(context, block);

IRubyObject elt0 = block.yield(context, car);

if (!packed()) return collectFrom(context, arrayOf(elt0), 1, block);

IRubyObject elt1 = block.yield(context, cdr);

if (!packed()) return collectFrom(context, arrayOf(elt0, elt1), 2, block);

return new RubyArrayTwoObject(getRuntime(), block.yield(context, car), block.yield(context, cdr));
}

@Override
public void copyInto(IRubyObject[] target, int start) {
if (!packed()) {
Expand Down

0 comments on commit fd44e62

Please sign in to comment.