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:
parent
8105bc022e
commit
e66c1cee86
1 changed files with 1 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue