Speed improvement for HashWithIndifferentAccess#values_at

上级 9f41edb5
......@@ -225,8 +225,8 @@ def default(*args)
# hash[:a] = 'x'
# hash[:b] = 'y'
# hash.values_at('a', 'b') # => ["x", "y"]
def values_at(*indices)
indices.collect { |key| self[convert_key(key)] }
def values_at(*keys)
super(*keys.map { |key| convert_key(key) })
end
# Returns an array of the values at the specified indices, but also
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册