Fix lru cache Get returning opposite
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
DataHoarder 2024-04-13 07:01:59 +02:00
parent 6a7cb676aa
commit 9dbb3394b8
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk

View file

@ -29,7 +29,7 @@ func NewLRUCache[K comparable, T any](size int) *LRUCache[K, T] {
}
func (c *LRUCache[K, T]) Get(key K) (value T, ok bool) {
if value, ok = c.values.Load().Get(key); !ok {
if value, ok = c.values.Load().Get(key); ok {
c.hits.Add(1)
return value, true
} else {