Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Perf: refactor _assign method to avoid inject and defining unneeded l…

…ocal var.

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information...
commit 6d8a6700a76470b791f3e76fe4ca5d5f179daa1d 1 parent 10a63e2
@miloops miloops authored spastorino committed
Showing with 1 addition and 5 deletions.
  1. +1 −5 actionpack/lib/action_view/test_case.rb
View
6 actionpack/lib/action_view/test_case.rb
@@ -189,11 +189,7 @@ def _instance_variables
end
def _assigns
- _instance_variables.inject({}) do |hash, var|
- name = var[1..-1].to_sym
- hash[name] = instance_variable_get(var)
- hash
- end
+ _instance_variables.map { |var| [ var[1..-1].to_sym, instance_variable_get(var)] }
end
def _routes
Please sign in to comment.
Something went wrong with that request. Please try again.