aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-05-03 05:06:40 -0700
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-05-03 05:06:40 -0700
commit84139bad77fda9899b2fa29e238730f38ca57f3c (patch)
tree5d9538daf7146497bdf23b46db711ea1772eea95 /activesupport/lib/active_support
parent30f297bef5fec202ee6b26e67c9e45fb7a500251 (diff)
parent6fa575bb4f744315470cc971804dd6d09b5b987f (diff)
downloadrails-84139bad77fda9899b2fa29e238730f38ca57f3c.tar.gz
rails-84139bad77fda9899b2fa29e238730f38ca57f3c.tar.bz2
rails-84139bad77fda9899b2fa29e238730f38ca57f3c.zip
Merge pull request #10413 from vipulnsward/change_grouping
Use faster Array.new instead of []*padding
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/array/grouping.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/array/grouping.rb b/activesupport/lib/active_support/core_ext/array/grouping.rb
index 640e6e9328..dbddc7a7b4 100644
--- a/activesupport/lib/active_support/core_ext/array/grouping.rb
+++ b/activesupport/lib/active_support/core_ext/array/grouping.rb
@@ -25,7 +25,7 @@ class Array
# 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?