From 6fa575bb4f744315470cc971804dd6d09b5b987f Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Thu, 2 May 2013 09:41:19 +0530 Subject: Use faster Array.new instead of []*padding --- activesupport/lib/active_support/core_ext/array/grouping.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support') 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? -- cgit v1.2.3