aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@gmail.com>2015-11-06 15:56:01 -0500
committerEileen M. Uchitelle <eileencodes@gmail.com>2015-11-06 15:56:01 -0500
commitf036eacd6c9150e20e262568f9ee9897a8bad74f (patch)
treeaf83f5336b2becd6c88c056a1bc2aa11c179d452 /activesupport
parentebe4e9b17c73ad7669506d0046678d0a9b637639 (diff)
parent2c42404330a3e7a1648a01e072035c2bee9cc118 (diff)
downloadrails-f036eacd6c9150e20e262568f9ee9897a8bad74f.tar.gz
rails-f036eacd6c9150e20e262568f9ee9897a8bad74f.tar.bz2
rails-f036eacd6c9150e20e262568f9ee9897a8bad74f.zip
Merge pull request #22193 from grosser/grosser/multi
call local_cache 1 time instead of 3 times
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/cache/strategy/local_cache.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/cache/strategy/local_cache.rb b/activesupport/lib/active_support/cache/strategy/local_cache.rb
index e1da2be2d4..4e2d3e9875 100644
--- a/activesupport/lib/active_support/cache/strategy/local_cache.rb
+++ b/activesupport/lib/active_support/cache/strategy/local_cache.rb
@@ -102,10 +102,10 @@ module ActiveSupport
protected
def read_entry(key, options) # :nodoc:
- if local_cache
- local_cache.fetch(key) do
+ if cache = local_cache
+ cache.fetch(key) do
entry = super
- local_cache.write_entry(key, entry, options)
+ cache.write_entry(key, entry, options)
entry
end
else