-
Notifications
You must be signed in to change notification settings - Fork 527
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
}
bodgit, bep, Jille and egor-heygenbodgit and bep
Metadata
Metadata
Assignees
Labels
No labels