Bump github.com/blevesearch/bleve/v2 from 2.3.7 to 2.3.9

Bumps [github.com/blevesearch/bleve/v2](https://github.com/blevesearch/bleve) from 2.3.7 to 2.3.9.
- [Release notes](https://github.com/blevesearch/bleve/releases)
- [Commits](https://github.com/blevesearch/bleve/compare/v2.3.7...v2.3.9)

---
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:
dependabot[bot]
2023-08-15 06:44:05 +00:00
committed by Ralf Haferkamp
parent 82b600aef5
commit f9b69afa9e
58 changed files with 1138 additions and 330 deletions
+36 -7
View File
@@ -350,7 +350,6 @@ func (bc *bitmapContainer) getCardinality() int {
return bc.cardinality
}
func (bc *bitmapContainer) isEmpty() bool {
return bc.cardinality == 0
}
@@ -1125,15 +1124,20 @@ func (bc *bitmapContainer) containerType() contype {
return bitmapContype
}
func (bc *bitmapContainer) addOffset(x uint16) []container {
low := newBitmapContainer()
high := newBitmapContainer()
func (bc *bitmapContainer) addOffset(x uint16) (container, container) {
var low, high *bitmapContainer
if bc.cardinality == 0 {
return nil, nil
}
b := uint32(x) >> 6
i := uint32(x) % 64
end := uint32(1024) - b
low = newBitmapContainer()
if i == 0 {
copy(low.bitmap[b:], bc.bitmap[:end])
copy(high.bitmap[:b], bc.bitmap[end:])
} else {
low.bitmap[b] = bc.bitmap[0] << i
for k := uint32(1); k < end; k++ {
@@ -1141,6 +1145,26 @@ func (bc *bitmapContainer) addOffset(x uint16) []container {
newval |= bc.bitmap[k-1] >> (64 - i)
low.bitmap[b+k] = newval
}
}
low.computeCardinality()
if low.cardinality == bc.cardinality {
// All elements from bc ended up in low, meaning high will be empty.
return low, nil
}
if low.cardinality == 0 {
// low is empty, let's reuse the container for high.
high = low
low = nil
} else {
// None of the containers will be empty, so allocate both.
high = newBitmapContainer()
}
if i == 0 {
copy(high.bitmap[:b], bc.bitmap[end:])
} else {
for k := end; k < 1024; k++ {
newval := bc.bitmap[k] << i
newval |= bc.bitmap[k-1] >> (64 - i)
@@ -1148,7 +1172,12 @@ func (bc *bitmapContainer) addOffset(x uint16) []container {
}
high.bitmap[b] = bc.bitmap[1023] >> (64 - i)
}
low.computeCardinality()
high.computeCardinality()
return []container{low, high}
// Ensure proper nil interface.
if low == nil {
return nil, high
}
return low, high
}