diff options
author | Akira Matsuda <ronnie@dio.jp> | 2013-07-10 22:38:36 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2013-07-10 22:59:32 +0900 |
commit | 50e11e989727b6886b25d61333ce40060514c3e2 (patch) | |
tree | b84ee950241953d99e6ccc0e3e7ec5184802cdd2 /activesupport | |
parent | f660abce9a39a23dfa7494ca856f2ae9e824f806 (diff) | |
download | rails-50e11e989727b6886b25d61333ce40060514c3e2.tar.gz rails-50e11e989727b6886b25d61333ce40060514c3e2.tar.bz2 rails-50e11e989727b6886b25d61333ce40060514c3e2.zip |
Simplify Array#in_groups_of code
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/array/grouping.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/array/grouping.rb b/activesupport/lib/active_support/core_ext/array/grouping.rb index 36896f9614..37f007c751 100644 --- a/activesupport/lib/active_support/core_ext/array/grouping.rb +++ b/activesupport/lib/active_support/core_ext/array/grouping.rb @@ -31,9 +31,7 @@ class Array if block_given? collection.each_slice(number) { |slice| yield(slice) } else - groups = [] - collection.each_slice(number) { |group| groups << group } - groups + collection.each_slice(number).to_a end end |