Delete an item from the cache. Does nothing if the key is not in the cache.
(k string)
| 921 | |
| 922 | // Delete an item from the cache. Does nothing if the key is not in the cache. |
| 923 | func (c *cache) Delete(k string) { |
| 924 | c.mu.Lock() |
| 925 | v, evicted := c.delete(k) |
| 926 | c.mu.Unlock() |
| 927 | if evicted { |
| 928 | c.onEvicted(k, v) |
| 929 | } |
| 930 | } |
| 931 | |
| 932 | func (c *cache) delete(k string) (interface{}, bool) { |
| 933 | if c.onEvicted != nil { |