update vendor

This commit is contained in:
ston1th 2025-10-15 22:37:57 +02:00
commit 8675bc4b7a
328 changed files with 27166 additions and 6537 deletions

View file

@ -888,13 +888,67 @@ func (bc *bitmapContainer) iandNot(a container) container {
}
func (bc *bitmapContainer) iandNotArray(ac *arrayContainer) container {
acb := ac.toBitmapContainer()
return bc.iandNotBitmapSurely(acb)
if ac.isEmpty() || bc.isEmpty() {
// Nothing to do.
return bc
}
// Word by word, we remove the elements in ac from bc. The approach is to build
// a mask of the elements to remove, and then apply it to the bitmap.
wordIdx := uint16(0)
mask := uint64(0)
for i, v := range ac.content {
if v/64 != wordIdx {
// Flush the current word.
if i != 0 {
// We're removing bits that are set in the mask and in the current word.
// To figure out the cardinality change, we count the number of bits that
// are set in the mask and in the current word.
mask &= bc.bitmap[wordIdx]
bc.bitmap[wordIdx] &= ^mask
bc.cardinality -= int(popcount(mask))
}
wordIdx = v / 64
mask = 0
}
mask |= 1 << (v % 64)
}
// Flush the last word.
mask &= bc.bitmap[wordIdx]
bc.bitmap[wordIdx] &= ^mask
bc.cardinality -= int(popcount(mask))
if bc.getCardinality() <= arrayDefaultMaxSize {
return bc.toArrayContainer()
}
return bc
}
func (bc *bitmapContainer) iandNotRun16(rc *runContainer16) container {
rcb := rc.toBitmapContainer()
return bc.iandNotBitmapSurely(rcb)
if rc.isEmpty() || bc.isEmpty() {
// Nothing to do.
return bc
}
wordRangeStart := rc.iv[0].start / 64
wordRangeEnd := (rc.iv[len(rc.iv)-1].last()) / 64 // inclusive
cardinalityChange := popcntSlice(bc.bitmap[wordRangeStart : wordRangeEnd+1]) // before cardinality - after cardinality (for word range)
for _, iv := range rc.iv {
resetBitmapRange(bc.bitmap, int(iv.start), int(iv.last())+1)
}
cardinalityChange -= popcntSlice(bc.bitmap[wordRangeStart : wordRangeEnd+1])
bc.cardinality -= int(cardinalityChange)
if bc.getCardinality() <= arrayDefaultMaxSize {
return bc.toArrayContainer()
}
return bc
}
func (bc *bitmapContainer) andNotArray(value2 *arrayContainer) container {
@ -1062,7 +1116,6 @@ func (bc *bitmapContainer) PrevSetBit(i int) int {
// reference the java implementation
// https://github.com/RoaringBitmap/RoaringBitmap/blob/master/src/main/java/org/roaringbitmap/BitmapContainer.java#L875-L892
//
func (bc *bitmapContainer) numberOfRuns() int {
if bc.cardinality == 0 {
return 0