diff options
author | Akira Matsuda <ronnie@dio.jp> | 2019-07-31 07:35:03 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2019-07-31 17:41:34 +0900 |
commit | 7e299ce230b3928609415a9797c6abef00561c45 (patch) | |
tree | 24963b21d4f7c6ce11078037c207ddc7c987a663 /activesupport | |
parent | acf7642ecec5bdbe6efcb419434b04b35531a2b5 (diff) | |
download | rails-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.rb | 2 |
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 |