diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-11-20 01:55:03 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-11-20 01:55:03 +0900 |
commit | 125095c2d5845044dc214e136c3a758b4ed205e3 (patch) | |
tree | c4d7614148b1d6c76b7bd0102589f6364d632278 /activesupport | |
parent | 83cb0fc6326b308322e35b211bac31c73b346b73 (diff) | |
download | rails-125095c2d5845044dc214e136c3a758b4ed205e3.tar.gz rails-125095c2d5845044dc214e136c3a758b4ed205e3.tar.bz2 rails-125095c2d5845044dc214e136c3a758b4ed205e3.zip |
Generate `keys` instead of `keys_to_names`
`keys_to_names` is used only for `keys_to_names.keys`.
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/cache/redis_cache_store.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/cache/redis_cache_store.rb b/activesupport/lib/active_support/cache/redis_cache_store.rb index 2cbeaef6fa..08200a556f 100644 --- a/activesupport/lib/active_support/cache/redis_cache_store.rb +++ b/activesupport/lib/active_support/cache/redis_cache_store.rb @@ -300,10 +300,10 @@ module ActiveSupport options = names.extract_options! options = merged_options(options) - keys_to_names = names.map { |name| [ normalize_key(name, options), name ] }.to_h - values = redis.mget(*keys_to_names.keys) + keys = names.map { |name| normalize_key(name, options) } + values = redis.mget(*keys) - keys_to_names.zip(values).each_with_object({}) do |((_, name), value), results| + names.zip(values).each_with_object({}) do |(name, value), results| if value entry = deserialize_entry(value) unless entry.nil? || entry.expired? || entry.mismatched?(normalize_version(name, options)) |