aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-06-02 14:26:36 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-06-02 14:32:16 -0700
commit9e4bb9991a72078a97510b01bb1010127a7a3706 (patch)
tree20d4170bc830cc9a599ebed5051573fe1e18d26c /activesupport
parent6b6eb94bba949fc457153201ea62cedd4cf19af1 (diff)
downloadrails-9e4bb9991a72078a97510b01bb1010127a7a3706.tar.gz
rails-9e4bb9991a72078a97510b01bb1010127a7a3706.tar.bz2
rails-9e4bb9991a72078a97510b01bb1010127a7a3706.zip
concat is a hotspot (via AV#append=), so just directly define the methods
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/string/output_safety.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb
index 2c8995be9a..d922eedbcd 100644
--- a/activesupport/lib/active_support/core_ext/string/output_safety.rb
+++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -170,13 +170,15 @@ module ActiveSupport #:nodoc:
self[0, 0]
end
- %w[concat prepend].each do |method_name|
- define_method method_name do |value|
- super(html_escape_interpolated_argument(value))
- end
+ def concat(value)
+ super(html_escape_interpolated_argument(value))
end
alias << concat
+ def prepend(value)
+ super(html_escape_interpolated_argument(value))
+ end
+
def prepend!(value)
ActiveSupport::Deprecation.deprecation_warning "ActiveSupport::SafeBuffer#prepend!", :prepend
prepend value