Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #10413 from vipulnsward/change_grouping

Use faster Array.new instead of []*padding
  • Loading branch information...
commit 84139bad77fda9899b2fa29e238730f38ca57f3c 2 parents 30f297b + 6fa575b
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  activesupport/lib/active_support/core_ext/array/grouping.rb
View
2  activesupport/lib/active_support/core_ext/array/grouping.rb
@@ -25,7 +25,7 @@ def in_groups_of(number, fill_with = nil)
# subtracting from number gives how many to add;
# modulo number ensures we don't add group of just fill.
padding = (number - size % number) % number
- collection = dup.concat([fill_with] * padding)
+ collection = dup.concat(Array.new(padding, fill_with))
end
if block_given?
Please sign in to comment.
Something went wrong with that request. Please try again.