Open
Description
lru always calls onEvict
once when Remove
is called. In a case where the element that I want to remove is already processed, and the processing logic is different from onEvict, I want to simply remove the element RemoveWithoutEvict
API, it may be written as follow:
func (c *Cache[K, V]) RemoveWithoutEvict(key K) (present bool) {
c.lock.Lock()
present = c.lru.Remove(key)
c.lock.Unlock()
return
}
Metadata
Metadata
Assignees
Labels
No labels