diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-05-03 05:06:40 -0700 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-05-03 05:06:40 -0700 |
commit | 84139bad77fda9899b2fa29e238730f38ca57f3c (patch) | |
tree | 5d9538daf7146497bdf23b46db711ea1772eea95 /activesupport/lib/active_support | |
parent | 30f297bef5fec202ee6b26e67c9e45fb7a500251 (diff) | |
parent | 6fa575bb4f744315470cc971804dd6d09b5b987f (diff) | |
download | rails-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.rb | 2 |
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? |