MCPcopy
hub / github.com/go-gorm/gorm / GetOldest

Method GetOldest

internal/lru/lru.go:211–218  ·  view source on GitHub ↗

GetOldest returns the oldest entry

()

Source from the content-addressed store, hash-verified

209
210// GetOldest returns the oldest entry
211func (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
220func (c *LRU[K, V]) KeyValues() map[K]V {
221 c.mu.RLock()

Callers 1

TestLRUWithPurgeFunction · 0.80

Calls 1

BackMethod · 0.80

Tested by 1

TestLRUWithPurgeFunction · 0.64