Disable LRU

This commit is contained in:
celo.choi 2024-03-22 15:18:56 +09:00
parent ac0ff04460
commit 0809c46266

View file

@ -16,7 +16,9 @@
package lru package lru
import "sync" import (
"sync"
)
// Cache is a LRU cache. // Cache is a LRU cache.
// This type is safe for concurrent use. // This type is safe for concurrent use.
@ -40,6 +42,7 @@ func (c *Cache[K, V]) Add(key K, value V) (evicted bool) {
// Contains reports whether the given key exists in the cache. // Contains reports whether the given key exists in the cache.
func (c *Cache[K, V]) Contains(key K) bool { func (c *Cache[K, V]) Contains(key K) bool {
return false
c.mu.Lock() c.mu.Lock()
defer c.mu.Unlock() defer c.mu.Unlock()
@ -48,6 +51,7 @@ func (c *Cache[K, V]) Contains(key K) bool {
// Get retrieves a value from the cache. This marks the key as recently used. // Get retrieves a value from the cache. This marks the key as recently used.
func (c *Cache[K, V]) Get(key K) (value V, ok bool) { func (c *Cache[K, V]) Get(key K) (value V, ok bool) {
return value, false
c.mu.Lock() c.mu.Lock()
defer c.mu.Unlock() defer c.mu.Unlock()