提交 783858c8 编写于 作者: A Aaron Patterson

drop array allocations on `html_safe`

For better or worse, anonymous `*` args will allocate arrays.  Ideally,
the interpreter would optimize away this allocation.  However, given the
number of times we call `html_safe` it seems worth the shedding idealism
and going for performance.  This line was the top allocation spot for a
scaffold (and presumably worse on real applications).
上级 02c38678
......@@ -171,7 +171,7 @@ def safe_concat(value)
original_concat(value)
end
def initialize(*)
def initialize(str = '')
@html_safe = true
super
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册