Skip to content

Commit

Permalink
Revert "call evict on replacing value (#135)"
Browse files Browse the repository at this point in the history
This reverts commit d260bc0.
  • Loading branch information
mgaffney committed Aug 23, 2023
1 parent 1e956f5 commit 0ed35fd
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions simplelru/lru.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ func (c *LRU[K, V]) Add(key K, value V) (evicted bool) {
// Check for existing item
if ent, ok := c.items[key]; ok {
c.evictList.MoveToFront(ent)
if c.onEvict != nil {
c.onEvict(key, ent.Value)
}
ent.Value = value
return false
}
Expand Down

0 comments on commit 0ed35fd

Please sign in to comment.