diff options
author | Timo Schilling <timo@schilling.io> | 2019-04-02 14:04:11 +0200 |
---|---|---|
committer | Timo Schilling <timo@schilling.io> | 2019-04-02 22:42:26 +0200 |
commit | 9f41edb535ae43faeadc4ef6d16e459435b170e0 (patch) | |
tree | 76261d331a6cf46fd9e587fb271813a662c1d1cd /activesupport | |
parent | a805d72e901f81f5b043dfd9904b80ce93ebfc01 (diff) | |
download | rails-9f41edb535ae43faeadc4ef6d16e459435b170e0.tar.gz rails-9f41edb535ae43faeadc4ef6d16e459435b170e0.tar.bz2 rails-9f41edb535ae43faeadc4ef6d16e459435b170e0.zip |
Speed improvement for HashWithIndifferentAccess#fetch_values
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/hash_with_indifferent_access.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb index a4e366f80f..e0117dacfc 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -239,7 +239,7 @@ module ActiveSupport # hash.fetch_values('a', 'c') { |key| 'z' } # => ["x", "z"] # hash.fetch_values('a', 'c') # => KeyError: key not found: "c" def fetch_values(*indices, &block) - indices.collect { |key| fetch(key, &block) } + super(*indices.map { |key| convert_key(key) }, &block) end # Returns a shallow copy of the hash. |