Skip to content
Browse files

Array#repeated_permutation should have arity 1

Remove arg-less Array#repeated_permutation to match MRI behavior.
  • Loading branch information...
1 parent f4a6f7e commit 89a7ba213f802c0dcc6ac27c906d83d3df3bdb53 @dmarcotte committed Dec 12, 2013
View
5 core/src/main/java/org/jruby/RubyArray.java
@@ -3708,11 +3708,6 @@ public IRubyObject repeated_permutation(ThreadContext context, IRubyObject num,
return block.isGiven() ? permutationCommon(context, RubyNumeric.num2int(num), true, block) : enumeratorize(context.runtime, this, "repeated_permutation", num);
}
- @JRubyMethod(name = "repeated_permutation", compat = RUBY1_9)
- public IRubyObject repeated_permutation(ThreadContext context, Block block) {
- return block.isGiven() ? permutationCommon(context, realLength, true, block) : enumeratorize(context.runtime, this, "repeated_permutation");
- }
-
private IRubyObject permutationCommon(ThreadContext context, int r, boolean repeat, Block block) {
if (r == 0) {
block.yield(context, newEmptyArray(context.runtime));
View
7 spec/regression/array_repeated_permutation_requires_arg_spec.rb
@@ -0,0 +1,7 @@
+require 'rspec'
+
+describe "Array#repeated_permutation" do
+ it "has arity one" do
+ [].method(:repeated_permutation).arity.should == 1
+ end
+end if RUBY_VERSION >= "1.9"

0 comments on commit 89a7ba2

Please sign in to comment.
Something went wrong with that request. Please try again.