diff --git a/weed/util/mem/slot_pool.go b/weed/util/mem/slot_pool.go index 2c729deef..1efb1b76b 100644 --- a/weed/util/mem/slot_pool.go +++ b/weed/util/mem/slot_pool.go @@ -42,7 +42,7 @@ func getSlotPool(size int) (*sync.Pool, bool) { func Allocate(size int) []byte { if pool, found := getSlotPool(size); found { slab := *pool.Get().(*[]byte) - for i := 0; i < size; i++ { + for i, _ := range slab { slab[i] = 0 } return slab[:size]