Sha256: 634f15e9bfe7fb5bc017afe586797950f7b88f8fd9cd49685f521c5c4fbf2480
Contents?: true
Size: 624 Bytes
Versions: 32
Compression:
Stored size: 624 Bytes
Contents
module Cuboid module Support::Cache # Least Recently Used cache implementation. # # Generally, the most desired mode under most circumstances. # Discards the least recently used entries in order to make room for newer ones. # # @author Tasos "Zapotek" Laskos <tasos.laskos@gmail.com> class LeastRecentlyUsed < LeastRecentlyPushed private def get_with_internal_key( k ) if !@cache.include? k @misses += 1 return end renew( k ) super k end def renew( internal_key ) @cache[internal_key] = @cache.delete( internal_key ) end end end end
Version data entries
32 entries across 32 versions & 1 rubygems