From 7e299ce230b3928609415a9797c6abef00561c45 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Wed, 31 Jul 2019 07:35:03 +0900 Subject: Reduce Array allocations --- activesupport/lib/active_support/inflector/methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') 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 -- cgit v1.2.3