From e9b7be5016854cc079b96f688516cd1cea04bebf Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Thu, 13 Aug 2020 15:49:28 +0800 Subject: [PATCH] remove race condition --- bucket.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bucket.go b/bucket.go index 3c09015..cf896c6 100644 --- a/bucket.go +++ b/bucket.go @@ -56,7 +56,7 @@ func (b *bucket) delete(key string) *Item { // write lock) func (b *bucket) deleteFunc(matches func(key string, item interface{}) bool, deletables chan *Item) int { lookup := b.lookup - items := make([]*Item, 0, len(lookup)/10) + items := make([]*Item, 0) b.RLock() for key, item := range lookup {