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

Reduce object allocation

This commit is contained in:
Akira Matsuda 2014-10-07 19:55:42 +09:00
parent ed03d4eaa8
commit f888448ed2

View file

@ -313,7 +313,7 @@ module ActionView
def locals_code #:nodoc:
# Double assign to suppress the dreaded 'assigned but unused variable' warning
@locals.map { |key| "#{key} = #{key} = local_assigns[:#{key}];" }.join
@locals.each_with_object('') { |key, code| code << "#{key} = #{key} = local_assigns[:#{key}];" }
end
def method_name #:nodoc: