GetOldest returns the oldest entry
()
| 209 | |
| 210 | // GetOldest returns the oldest entry |
| 211 | func (c *LRU[K, V]) GetOldest() (key K, value V, ok bool) { |
| 212 | c.mu.RLock() |
| 213 | defer c.mu.RUnlock() |
| 214 | if ent := c.evictList.Back(); ent != nil { |
| 215 | return ent.Key, ent.Value, true |
| 216 | } |
| 217 | return |
| 218 | } |
| 219 | |
| 220 | func (c *LRU[K, V]) KeyValues() map[K]V { |
| 221 | c.mu.RLock() |