make sure roaring.Bitmaps are created appropriately

This commit is contained in:
Matthew Jaffee 2017-12-18 15:07:28 -06:00 committed by Travis Turner
parent d798963798
commit a42a1a2c37
No known key found for this signature in database
GPG key ID: 7F08008DFD9314C9

View file

@ -189,11 +189,12 @@ func (b *Bitmap) createSegmentIfNotExists(slice uint64) *BitmapSegment {
}
// Insert new segment.
b.segments = append(b.segments, BitmapSegment{})
b.segments = append(b.segments, BitmapSegment{data: *roaring.NewBitmap()})
if i < len(b.segments) {
copy(b.segments[i+1:], b.segments[i:])
}
b.segments[i] = BitmapSegment{
data: *roaring.NewBitmap(),
slice: slice,
writable: true,
}