Skip to content
Browse files

Cache partial variable names to reduce garbage

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8793 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 53eca3a commit 72640c61252e43ed51da368a3122fd507b7b93a6 @jeremy jeremy committed Feb 3, 2008
Showing with 3 additions and 1 deletion.
  1. +3 −1 actionpack/lib/action_view/partials.rb
View
4 actionpack/lib/action_view/partials.rb
@@ -172,7 +172,9 @@ def partial_counter_name(partial_name)
end
def partial_variable_name(partial_name)
- partial_name.split('/').last.split('.').first.intern
+ @@partial_variable_names ||= {}
+ @@partial_variable_names[partial_name] ||=
+ partial_name.split('/').last.split('.').first.intern
end
def extracting_object(partial_name, object_assigns)

0 comments on commit 72640c6

Please sign in to comment.
Something went wrong with that request. Please try again.