chore(deps): bump github.com/blevesearch/bleve/v2 from 2.4.0 to 2.4.2
Bumps [github.com/blevesearch/bleve/v2](https://github.com/blevesearch/bleve) from 2.4.0 to 2.4.2. - [Release notes](https://github.com/blevesearch/bleve/releases) - [Commits](https://github.com/blevesearch/bleve/compare/v2.4.0...v2.4.2) --- updated-dependencies: - dependency-name: github.com/blevesearch/bleve/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
Ralf Haferkamp
parent
840eb734fa
commit
d31e179e86
+58
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user