From 36ef82d7acb095e0eb8bd44de83fd97aa739ed7d Mon Sep 17 00:00:00 2001 From: Seebs Date: Fri, 22 Nov 2019 13:52:05 -0600 Subject: [PATCH] Zero bitmap storage when reusing it for container-as-bitmap If you don't do this, it works fine the first time you use a given storage, but after that you start seeing spurious bits. --- roaring/container_stash.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roaring/container_stash.go b/roaring/container_stash.go index 8aab2f4d3..89c63ac8f 100644 --- a/roaring/container_stash.go +++ b/roaring/container_stash.go @@ -428,6 +428,9 @@ func (c *Container) AsBitmap(target []uint64) (out []uint64) { out = make([]uint64, 1024) } else { out = target + for i := range out { + out[i] = 0 + } } if c.typeID == containerArray { a := c.array()