two argument String#slice is faster than single argument, also avoid creating a Range object
This commit is contained in:
parent
5154a464cc
commit
a6c42c8267
|
@ -201,7 +201,7 @@ module ActionView
|
||||||
# frameworks.
|
# frameworks.
|
||||||
def view_assigns
|
def view_assigns
|
||||||
Hash[_user_defined_ivars.map do |var|
|
Hash[_user_defined_ivars.map do |var|
|
||||||
[var[1..-1].to_sym, instance_variable_get(var)]
|
[var[1, var.length].to_sym, instance_variable_get(var)]
|
||||||
end]
|
end]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue