two argument String#slice is faster than single argument, also avoid creating a Range object

This commit is contained in:
Aaron Patterson 2010-10-03 15:38:17 -07:00
parent 5154a464cc
commit a6c42c8267
1 changed files with 1 additions and 1 deletions

View File

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