1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Perf: refactor _assign method to avoid inject and defining unneeded local var.

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
Emilio Tagua 2010-09-22 11:38:33 -03:00 committed by Santiago Pastorino
parent 8105bc022e
commit e66c1cee86

View file

@ -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