aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2019-07-31 01:32:55 +0900
committerAkira Matsuda <ronnie@dio.jp>2019-07-31 11:51:19 +0900
commitf915341628f09c2bd175f17f03bbdf44e6213eb4 (patch)
treed251f48d7bd0c0e521be0ea32192299c8886ad67 /actionpack
parent303f388d93aa02a645a80cecafdde61cb6fee9f2 (diff)
downloadrails-f915341628f09c2bd175f17f03bbdf44e6213eb4.tar.gz
rails-f915341628f09c2bd175f17f03bbdf44e6213eb4.tar.bz2
rails-f915341628f09c2bd175f17f03bbdf44e6213eb4.zip
Reduce unnecessary String creation by not `to_s`ing until nothing matches
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/renderer.rb2
1 files changed, 1 insertions, 1 deletions
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)