diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-12-03 14:55:49 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-12-03 14:56:14 -0800 |
commit | 4d648819c5662f375b8ca431a14511ae6a97a29c (patch) | |
tree | 285bf142d94f5ba921a7101c08107f12fefbdae9 | |
parent | d5332de37963ab41372541fc8cf66f602663abf4 (diff) | |
download | rails-4d648819c5662f375b8ca431a14511ae6a97a29c.tar.gz rails-4d648819c5662f375b8ca431a14511ae6a97a29c.tar.bz2 rails-4d648819c5662f375b8ca431a14511ae6a97a29c.zip |
optimize string literals in erb templates
-rw-r--r-- | actionview/lib/action_view/template/handlers/erb.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionview/lib/action_view/template/handlers/erb.rb b/actionview/lib/action_view/template/handlers/erb.rb index c8a0059596..4523060442 100644 --- a/actionview/lib/action_view/template/handlers/erb.rb +++ b/actionview/lib/action_view/template/handlers/erb.rb @@ -18,7 +18,7 @@ module ActionView src << "@output_buffer.safe_append='" src << "\n" * @newline_pending if @newline_pending > 0 src << escape_text(text) - src << "';" + src << "'.freeze;" @newline_pending = 0 end @@ -67,7 +67,7 @@ module ActionView def flush_newline_if_pending(src) if @newline_pending > 0 - src << "@output_buffer.safe_append='#{"\n" * @newline_pending}';" + src << "@output_buffer.safe_append='#{"\n" * @newline_pending}'.freeze;" @newline_pending = 0 end end |