aboutsummaryrefslogtreecommitdiff
path: root/internal/lru/clear.go
blob: 42f9c50eaeccb6adab4cef60d82e666e4cf71899 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
package lru

// Clear removes all entries from the cache.
func (cache *Cache[K, V]) Clear() {
	for elem := cache.lru.Front(); elem != nil; {
		next := elem.Next()
		cache.removeElem(elem)
		elem = next
	}
}