Skip to content

Commit

Permalink
Ruby 1.9.2: use recursive flatten
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Nov 14, 2009
1 parent f0f4dff commit 6ebb061
Showing 1 changed file with 1 addition and 7 deletions.
Expand Up @@ -264,13 +264,7 @@ def flatten_deeper(array)
end
else
def flatten_deeper(array)
array.sum [] do |elem|
if elem.respond_to?(:each)
flatten_deeper(elem)
else
[elem]
end
end
array.flatten
end
end

Expand Down

0 comments on commit 6ebb061

Please sign in to comment.