aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/array
diff options
context:
space:
mode:
authorVipul A M <vipulnsward@gmail.com>2013-05-02 09:41:19 +0530
committerVipul A M <vipulnsward@gmail.com>2013-05-02 09:41:19 +0530
commit6fa575bb4f744315470cc971804dd6d09b5b987f (patch)
treebefd6659f8e3e1c693d8bde7a729bd6687ccdcba /activesupport/lib/active_support/core_ext/array
parent630d2e4e38f06b3998c663aa3e3bbd554ec2a78b (diff)
downloadrails-6fa575bb4f744315470cc971804dd6d09b5b987f.tar.gz
rails-6fa575bb4f744315470cc971804dd6d09b5b987f.tar.bz2
rails-6fa575bb4f744315470cc971804dd6d09b5b987f.zip
Use faster Array.new instead of []*padding
Diffstat (limited to 'activesupport/lib/active_support/core_ext/array')
-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?