提交 02174a3e 编写于 作者: A Aaron Patterson

Move two hotspots to use Hash[] rather than Hash#dup

https://bugs.ruby-lang.org/issues/7166
上级 046ab843
......@@ -91,8 +91,10 @@ def new(*args, &block)
end
def initialize_copy(other)
@values = @values.dup
@values[:bind] = @values[:bind].dup if @values[:bind]
# This method is a hot spot, so for now, use Hash[] to dup the hash.
# https://bugs.ruby-lang.org/issues/7166
@values = Hash[@values]
@values[:bind] = @values[:bind].dup if @values.key? :bind
reset
end
......@@ -540,7 +542,7 @@ def blank?
end
def values
@values.dup
Hash[@values]
end
def inspect
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册