Use typed *Item in DeleteFunc

This commit is contained in:
Bjørn Erik Pedersen
2020-08-13 16:10:22 +02:00
parent e9b7be5016
commit a42bd4a9c8
6 changed files with 13 additions and 13 deletions

View File

@@ -64,7 +64,7 @@ func (c *Cache) DeletePrefix(prefix string) int {
}
// Deletes all items that the matches func evaluates to true.
func (c *Cache) DeleteFunc(matches func(key string, item interface{}) bool) int {
func (c *Cache) DeleteFunc(matches func(key string, item *Item) bool) int {
count := 0
for _, b := range c.buckets {
count += b.deleteFunc(matches, c.deletables)