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
This commit is contained in:
k0kubun 2017-05-26 14:17:55 +00:00
parent 9f9f8236ff
commit 43572889b3

View File

@ -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