diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-06-02 14:26:36 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-06-02 14:32:16 -0700 |
commit | 9e4bb9991a72078a97510b01bb1010127a7a3706 (patch) | |
tree | 20d4170bc830cc9a599ebed5051573fe1e18d26c /activesupport | |
parent | 6b6eb94bba949fc457153201ea62cedd4cf19af1 (diff) | |
download | rails-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.rb | 10 |
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 |