diff options
author | Akira Matsuda <ronnie@dio.jp> | 2014-10-07 19:55:42 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2014-10-25 12:59:37 +0900 |
commit | f888448ed289fd7b32c30e48ff3c3b9334ed1d22 (patch) | |
tree | 51694401433af0ba00e105237535aceac23a1c6b /actionview/lib/action_view | |
parent | ed03d4eaa89a7b4ab09e7f5da76b522d04650daf (diff) | |
download | rails-f888448ed289fd7b32c30e48ff3c3b9334ed1d22.tar.gz rails-f888448ed289fd7b32c30e48ff3c3b9334ed1d22.tar.bz2 rails-f888448ed289fd7b32c30e48ff3c3b9334ed1d22.zip |
Reduce object allocation
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/template.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb index 379f31bdaf..79a511f800 100644 --- a/actionview/lib/action_view/template.rb +++ b/actionview/lib/action_view/template.rb @@ -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: |