Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use slice to avoid range allocation

  • Loading branch information...
commit 9a4adb4b05dafa9d61ec88acdd089b79585ce10e 1 parent 697acc4
@tenderlove tenderlove authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 actionpack/lib/abstract_controller/rendering.rb
View
4 actionpack/lib/abstract_controller/rendering.rb
@@ -69,7 +69,9 @@ def view_assigns
variables = instance_variables
variables -= protected_instance_variables
variables -= DEFAULT_PROTECTED_INSTANCE_VARIABLES
- variables.each { |name| hash[name[1..-1]] = instance_variable_get(name) }
+ variables.each { |name|
+ hash[name.slice(1, name.length)] = instance_variable_get(name)
+ }
hash
end
Please sign in to comment.
Something went wrong with that request. Please try again.