From 51489746026eb662aa44e07749db85f368766f3e Mon Sep 17 00:00:00 2001 From: Seebs Date: Wed, 30 Mar 2022 15:16:25 -0500 Subject: [PATCH] trust cell.BitN a few more places Found a couple of places where we were still not trusting this, but really we're testing it a lot more carefully now. --- rbf/cursorx.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rbf/cursorx.go b/rbf/cursorx.go index 362cd2970..fca85647a 100644 --- a/rbf/cursorx.go +++ b/rbf/cursorx.go @@ -177,7 +177,7 @@ func intoContainer(l leafCell, tx *Tx, replacing *roaring.Container, target []by case ContainerTypeBitmapPtr: _, bm, _ := tx.leafCellBitmap(toPgno(cpMaybe)) cloneMaybe := bm - c = roaring.RemakeContainerBitmap(replacing, cloneMaybe) + c = roaring.RemakeContainerBitmapN(replacing, cloneMaybe, int32(l.BitN)) case ContainerTypeBitmap: c = roaring.RemakeContainerBitmapN(replacing, toArray64(cpMaybe), int32(l.BitN)) case ContainerTypeRLE: @@ -245,11 +245,11 @@ func toContainer(l leafCell, tx *Tx) (c *roaring.Container) { case ContainerTypeBitmapPtr: _, bm, _ := tx.leafCellBitmap(toPgno(cpMaybe)) cloneMaybe := bm - c = roaring.NewContainerBitmap(-1, cloneMaybe) + c = roaring.NewContainerBitmap(l.BitN, cloneMaybe) case ContainerTypeBitmap: - c = roaring.NewContainerBitmap(-1, toArray64(cpMaybe)) + c = roaring.NewContainerBitmap(l.BitN, toArray64(cpMaybe)) case ContainerTypeRLE: - c = roaring.NewContainerRun(toInterval16(cpMaybe)) + c = roaring.NewContainerRunN(toInterval16(cpMaybe), int32(l.BitN)) } // Note: If the "roaringparanoia" build tag isn't set, this // should be optimized away entirely. Otherwise it's moderately