aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2019-07-31 07:35:03 +0900
committerAkira Matsuda <ronnie@dio.jp>2019-07-31 17:41:34 +0900
commit7e299ce230b3928609415a9797c6abef00561c45 (patch)
tree24963b21d4f7c6ce11078037c207ddc7c987a663 /activesupport
parentacf7642ecec5bdbe6efcb419434b04b35531a2b5 (diff)
downloadrails-7e299ce230b3928609415a9797c6abef00561c45.tar.gz
rails-7e299ce230b3928609415a9797c6abef00561c45.tar.bz2
rails-7e299ce230b3928609415a9797c6abef00561c45.zip
Reduce Array allocations
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/inflector/methods.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/inflector/methods.rb b/activesupport/lib/active_support/inflector/methods.rb
index d33c79d60e..2c0323396f 100644
--- a/activesupport/lib/active_support/inflector/methods.rb
+++ b/activesupport/lib/active_support/inflector/methods.rb
@@ -375,7 +375,7 @@ module ActiveSupport
last = parts.pop
- parts.reverse.inject(last) do |acc, part|
+ parts.reverse!.inject(last) do |acc, part|
part.empty? ? acc : "#{part}(::#{acc})?"
end
end