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:
parent
ed03d4eaa8
commit
f888448ed2
1 changed files with 1 additions and 1 deletions
|
@ -313,7 +313,7 @@ module ActionView
|
||||||
|
|
||||||
def locals_code #:nodoc:
|
def locals_code #:nodoc:
|
||||||
# Double assign to suppress the dreaded 'assigned but unused variable' warning
|
# 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
|
end
|
||||||
|
|
||||||
def method_name #:nodoc:
|
def method_name #:nodoc:
|
||||||
|
|
Loading…
Reference in a new issue