提交 9e4bb999 编写于 作者: A Aaron Patterson

concat is a hotspot (via AV#append=), so just directly define the methods

上级 6b6eb94b
......@@ -170,13 +170,15 @@ def clone_empty
self[0, 0]
end
%w[concat prepend].each do |method_name|
define_method method_name do |value|
super(html_escape_interpolated_argument(value))
end
def concat(value)
super(html_escape_interpolated_argument(value))
end
alias << concat
def prepend(value)
super(html_escape_interpolated_argument(value))
end
def prepend!(value)
ActiveSupport::Deprecation.deprecation_warning "ActiveSupport::SafeBuffer#prepend!", :prepend
prepend value
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册