Permalink
Browse files

Revert "Perf: refactor _assign method to avoid inject and defining un…

…needed local var."

_assigns must return a hash.

This reverts commit e66c1ce.
  • Loading branch information...
josevalim committed Oct 2, 2010
1 parent 87104a7 commit f9b5f63319602b932fc8c3c2c610a0d5e4c94ad0
Showing with 5 additions and 1 deletion.
  1. +5 −1 actionpack/lib/action_view/test_case.rb
@@ -189,7 +189,11 @@ def _instance_variables
end
def _assigns
- _instance_variables.map { |var| [var[1..-1].to_sym, instance_variable_get(var)] }
+ _instance_variables.inject({}) do |hash, var|
+ name = var[1..-1].to_sym
+ hash[name] = instance_variable_get(var)
+ hash
+ end
end
def _routes

0 comments on commit f9b5f63

Please sign in to comment.