提交 c1dadf3d 编写于 作者: C Carlos Antonio da Silva

Avoid creating an extra hash

上级 d97ba0d3
......@@ -246,11 +246,11 @@ def reject(*args, &block)
# Convert to a regular hash with string keys.
def to_hash
_new_hash = {}
_new_hash = Hash.new(default)
each do |key, value|
_new_hash[key] = convert_value(value, for: :to_hash)
end
Hash.new(default).merge!(_new_hash)
_new_hash
end
protected
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册