1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Avoid creating unneeded Hash instance and calling slow Hash#fetch

This commit is contained in:
Akira Matsuda 2014-10-07 19:50:27 +09:00
parent 314f320c78
commit 9461583d3f

View file

@ -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])