Permalink
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...
1 parent 10a63e2 commit 6d8a6700a76470b791f3e76fe4ca5d5f179daa1d @miloops miloops committed with spastorino Sep 22, 2010
Showing with 1 addition and 5 deletions.
  1. +1 −5 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

0 comments on commit 6d8a670

Please sign in to comment.