mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04: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:
committed by
Santiago Pastorino
parent
10a63e2a0c
commit
6d8a6700a7
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user