diff options
author | Timo Schilling <timo@schilling.io> | 2019-04-02 11:48:39 +0200 |
---|---|---|
committer | Timo Schilling <timo@schilling.io> | 2019-04-02 22:58:52 +0200 |
commit | 49598c0638b8f8afeb10b20cf64ff83a2ea1d8b2 (patch) | |
tree | 039dee2d6fdd7a14764dd12427bc58be9a853058 /activesupport/lib/active_support/hash_with_indifferent_access.rb | |
parent | 9f41edb535ae43faeadc4ef6d16e459435b170e0 (diff) | |
download | rails-49598c0638b8f8afeb10b20cf64ff83a2ea1d8b2.tar.gz rails-49598c0638b8f8afeb10b20cf64ff83a2ea1d8b2.tar.bz2 rails-49598c0638b8f8afeb10b20cf64ff83a2ea1d8b2.zip |
Speed improvement for HashWithIndifferentAccess#values_at
Diffstat (limited to 'activesupport/lib/active_support/hash_with_indifferent_access.rb')
-rw-r--r-- | activesupport/lib/active_support/hash_with_indifferent_access.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb index e0117dacfc..42ae7e9b7b 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -225,8 +225,8 @@ module ActiveSupport # 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 |