diff --git a/roaring/roaring.go b/roaring/roaring.go index 035f17ac7..2fe76e8ef 100644 --- a/roaring/roaring.go +++ b/roaring/roaring.go @@ -233,15 +233,15 @@ func (b *Bitmap) Count() (n uint64) { } // Size returns the number of bytes required for the bitmap. -func (b *Bitmap) Size() (numbytes int) { - +func (b *Bitmap) Size() int { + numbytes := 0 citer, _ := b.Containers.Iterator(0) for citer.Next() { _, c := citer.Value() numbytes += c.size() } - return + return numbytes } // CountRange returns the number of bits set between [start, end).