From 125095c2d5845044dc214e136c3a758b4ed205e3 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Mon, 20 Nov 2017 01:55:03 +0900 Subject: Generate `keys` instead of `keys_to_names` `keys_to_names` is used only for `keys_to_names.keys`. --- activesupport/lib/active_support/cache/redis_cache_store.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activesupport/lib/active_support/cache') 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)) -- cgit v1.2.3