From 50f119df4e21779495057ef43ef2b9451c2a8387 Mon Sep 17 00:00:00 2001 From: Richard Artoul Date: Thu, 29 Nov 2018 10:02:24 -0500 Subject: [PATCH] Allocate bitmap if needed (existing wrong type --- roaring/roaring.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roaring/roaring.go b/roaring/roaring.go index f152a5656..9b40399f0 100644 --- a/roaring/roaring.go +++ b/roaring/roaring.go @@ -519,7 +519,7 @@ func (b *Bitmap) unionIntoTarget(target *Bitmap, others ...*Bitmap) { // else { // Use a bitmap container := target.Containers.Get(iKey) - if container == nil { + if container == nil || container.containerType != containerBitmap { buf := make([]uint64, bitmapN) ob := buf[:bitmapN] container = &Container{