aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2014-10-07 19:59:58 +0900
committerAkira Matsuda <ronnie@dio.jp>2014-10-25 12:59:37 +0900
commita60e6ddb83b036f9b92af5dbcfda265cd0fde3b2 (patch)
tree8e440cba69faf5f1ac2f675718910b75b6cd6b00
parentf888448ed289fd7b32c30e48ff3c3b9334ed1d22 (diff)
downloadrails-a60e6ddb83b036f9b92af5dbcfda265cd0fde3b2.tar.gz
rails-a60e6ddb83b036f9b92af5dbcfda265cd0fde3b2.tar.bz2
rails-a60e6ddb83b036f9b92af5dbcfda265cd0fde3b2.zip
Reduce object allocation
-rw-r--r--actionview/lib/action_view/template.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb
index 79a511f800..6b61378a1f 100644
--- a/actionview/lib/action_view/template.rb
+++ b/actionview/lib/action_view/template.rb
@@ -317,7 +317,11 @@ module ActionView
end
def method_name #:nodoc:
- @method_name ||= "_#{identifier_method_name}__#{@identifier.hash}_#{__id__}".tr('-', "_")
+ @method_name ||= begin
+ m = "_#{identifier_method_name}__#{@identifier.hash}_#{__id__}"
+ m.tr!('-', '_')
+ m
+ end
end
def identifier_method_name #:nodoc: