aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erb.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-15 07:20:07 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-15 07:20:07 +0000
commit0fd3fe001d5f0862200f6fb69b289b42518c0a6b (patch)
tree3472cfcb33fdfec2dff808add0a1775f34334960 /lib/erb.rb
parent4bd1d6b2a1b4df3d2e9d2725dba379cc16893b8d (diff)
downloadruby-0fd3fe001d5f0862200f6fb69b289b42518c0a6b.tar.gz
* lib/erb.rb: Render erb with array buffer for function call optimization.
[fix GH-1143] * lib/rdoc/erb_partial.rb: ditto. * template/verconf.h.tmpl: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/erb.rb')
-rw-r--r--lib/erb.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/erb.rb b/lib/erb.rb
index b099c82ff7..7b328bffb0 100644
--- a/lib/erb.rb
+++ b/lib/erb.rb
@@ -589,7 +589,7 @@ class ERB
end
def add_insert_cmd(out, content)
- out.push("#{@insert_cmd}((#{content}).to_s)")
+ out.push("#{@insert_cmd}((#{content}))")
end
# Compiles an ERB template into Ruby code. Returns an array of the code
@@ -834,10 +834,10 @@ class ERB
# requires the setup of an ERB _compiler_ object.
#
def set_eoutvar(compiler, eoutvar = '_erbout')
- compiler.put_cmd = "#{eoutvar}.concat"
- compiler.insert_cmd = "#{eoutvar}.concat"
- compiler.pre_cmd = ["#{eoutvar} = ''"]
- compiler.post_cmd = ["#{eoutvar}.force_encoding(__ENCODING__)"]
+ compiler.put_cmd = "#{eoutvar}.push"
+ compiler.insert_cmd = "#{eoutvar}.push"
+ compiler.pre_cmd = ["#{eoutvar} = []"]
+ compiler.post_cmd = ["#{eoutvar}.join.force_encoding(__ENCODING__)"]
end
# Generate results and print them. (see ERB#result)