ruby-changes:46793
From: k0kubun <ko1@a...>
Date: Fri, 26 May 2017 23:18:00 +0900 (JST)
Subject: [ruby-changes:46793] k0kubun:r58908 (trunk): erb.rb: Tiny improvement of compiling cost
k0kubun 2017-05-26 23:17:55 +0900 (Fri, 26 May 2017) New Revision: 58908 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58908 Log: erb.rb: Tiny improvement of compiling cost by reducing string allocation. * Before app_erb 0.687 * After app_erb 0.679 Modified files: trunk/lib/erb.rb Index: lib/erb.rb =================================================================== --- lib/erb.rb (revision 58907) +++ lib/erb.rb (revision 58908) @@ -582,7 +582,7 @@ class ERB https://github.com/ruby/ruby/blob/trunk/lib/erb.rb#L582 def content_dump(s) # :nodoc: n = s.count("\n") if n > 0 - s.dump + "\n" * n + s.dump << "\n" * n else s.dump end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/