Permalink
Browse files

fix bug in Array#permutations: caused during bootstrapping

  • Loading branch information...
bakkdoor committed Nov 15, 2013
1 parent 27583ce commit 9b89b2e544dbb5a38643f3dc8b8cac0372e1c43c
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/rbx/array.fy
@@ -140,7 +140,7 @@ class Array {
unshift(value)
}
def permutations: size (self size) {
def permutations: size (nil) {
"""
@size Optional size of permutations to be returned. Defaults to @self's size.
@return @Enumerable::Enumerator@ of all permutations of @self.
@@ -153,6 +153,10 @@ class Array {
# => [[1, 2], [1, 3], [2, 1], [2, 3], [3, 1], [3, 2]]
"""
match size {
case nil -> size = self size
}
to_enum('permutation, size)
}
}

0 comments on commit 9b89b2e

Please sign in to comment.