Speed improvement for HashWithIndifferentAccess#values_at

上级 9f41edb5
...@@ -225,8 +225,8 @@ def default(*args) ...@@ -225,8 +225,8 @@ def default(*args)
# hash[:a] = 'x' # hash[:a] = 'x'
# hash[:b] = 'y' # hash[:b] = 'y'
# hash.values_at('a', 'b') # => ["x", "y"] # hash.values_at('a', 'b') # => ["x", "y"]
def values_at(*indices) def values_at(*keys)
indices.collect { |key| self[convert_key(key)] } super(*keys.map { |key| convert_key(key) })
end end
# Returns an array of the values at the specified indices, but also # 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.
先完成此消息的编辑!
想要评论请 注册