diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-09-22 11:38:33 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-09-22 18:08:03 -0300 |
commit | 6d8a6700a76470b791f3e76fe4ca5d5f179daa1d (patch) | |
tree | 3b62f76487e73f9905fc7a7fbc1a03bd52f4124b /actionpack/lib/action_view | |
parent | 10a63e2a0cbdc1e8e4d7aef87afc868bd599ca94 (diff) | |
download | rails-6d8a6700a76470b791f3e76fe4ca5d5f179daa1d.tar.gz rails-6d8a6700a76470b791f3e76fe4ca5d5f179daa1d.tar.bz2 rails-6d8a6700a76470b791f3e76fe4ca5d5f179daa1d.zip |
Perf: refactor _assign method to avoid inject and defining unneeded local var.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/test_case.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index 2c2661df26..34ed76707e 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -189,11 +189,7 @@ module ActionView 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 |