From f915341628f09c2bd175f17f03bbdf44e6213eb4 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Wed, 31 Jul 2019 01:32:55 +0900 Subject: Reduce unnecessary String creation by not `to_s`ing until nothing matches --- actionpack/lib/action_controller/renderer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/lib/action_controller/renderer.rb b/actionpack/lib/action_controller/renderer.rb index dadf6d3445..af344b98d2 100644 --- a/actionpack/lib/action_controller/renderer.rb +++ b/actionpack/lib/action_controller/renderer.rb @@ -120,7 +120,7 @@ module ActionController } def rack_key_for(key) - RACK_KEY_TRANSLATION.fetch(key, key.to_s) + RACK_KEY_TRANSLATION[key] || key.to_s end def rack_value_for(key, value) -- cgit v1.2.3