Len returns the number of items in the cache.
()
| 266 | |
| 267 | // Len returns the number of items in the cache. |
| 268 | func (c *LRU[K, V]) Len() int { |
| 269 | c.mu.RLock() |
| 270 | defer c.mu.RUnlock() |
| 271 | return c.evictList.Length() |
| 272 | } |
| 273 | |
| 274 | // Resize changes the cache size. Size of 0 means unlimited. |
| 275 | func (c *LRU[K, V]) Resize(size int) (evicted int) { |