diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-26 14:17:55 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-26 14:17:55 +0000 |
commit | 43572889b3ecd8442574da98988fa187eaa04169 (patch) | |
tree | bcf45e8b053dadf9fbaaf6e1a934073a723c876e | |
parent | 9f9f8236ff18d4e09fa404f38dbc06375347b096 (diff) |
erb.rb: Tiny improvement of compiling cost
by reducing string allocation.
* Before
app_erb 0.687
* After
app_erb 0.679
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/erb.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/erb.rb b/lib/erb.rb index 8cb68eedb9..dcd190fcbb 100644 --- a/lib/erb.rb +++ b/lib/erb.rb @@ -582,7 +582,7 @@ class ERB def content_dump(s) # :nodoc: n = s.count("\n") if n > 0 - s.dump + "\n" * n + s.dump << "\n" * n else s.dump end |