Skip to content

Commit

Permalink
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -825,6 +825,11 @@ public Object compactObjects(RubyArray array) {
return new RubyArray(getContext().getCoreLibrary().getArrayClass(), newStore, m);
}

@Specialization(guards = "isNullArray")
public Object compactNull(RubyArray array) {
return new RubyArray(getContext().getCoreLibrary().getArrayClass(), null, 0);
}

}

@CoreMethod(names = "compact!", raiseIfFrozenSelf = true)

0 comments on commit 539b3da

Please sign in to comment.