aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2014-10-07 19:50:27 +0900
committerAkira Matsuda <ronnie@dio.jp>2014-10-25 12:59:37 +0900
commit9461583d3fe8b0269ebdf0ebefc1304f658f4bcd (patch)
treee77659347a12cb6bf33d1f4d3b7391d4313ba704 /actionview
parent314f320c781c8dad0fef68d6431ded3dc70eaf42 (diff)
downloadrails-9461583d3fe8b0269ebdf0ebefc1304f658f4bcd.tar.gz
rails-9461583d3fe8b0269ebdf0ebefc1304f658f4bcd.tar.bz2
rails-9461583d3fe8b0269ebdf0ebefc1304f658f4bcd.zip
Avoid creating unneeded Hash instance and calling slow Hash#fetch
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/renderer/template_renderer.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/renderer/template_renderer.rb b/actionview/lib/action_view/renderer/template_renderer.rb
index f3a48ecfa0..cd21d7ab47 100644
--- a/actionview/lib/action_view/renderer/template_renderer.rb
+++ b/actionview/lib/action_view/renderer/template_renderer.rb
@@ -18,7 +18,7 @@ module ActionView
# Determine the template to be rendered using the given options.
def determine_template(options)
- keys = options.fetch(:locals, {}).keys
+ keys = options.has_key?(:locals) ? options[:locals].keys : []
if options.key?(:body)
Template::Text.new(options[:body])