MM-27613: Update dependencies (#15294)
https://mattermost.atlassian.net/browse/MM-27613
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
54f86e7fb1
Коммит
f2a8e10216
36
vendor/github.com/RoaringBitmap/roaring/roaring.go
сгенерированный
поставляемый
36
vendor/github.com/RoaringBitmap/roaring/roaring.go
сгенерированный
поставляемый
@@ -346,7 +346,9 @@ func newIntReverseIterator(a *Bitmap) *intReverseIterator {
|
||||
// ManyIntIterable allows you to iterate over the values in a Bitmap
|
||||
type ManyIntIterable interface {
|
||||
// pass in a buffer to fill up with values, returns how many values were returned
|
||||
NextMany([]uint32) int
|
||||
NextMany(buf []uint32) int
|
||||
// pass in a buffer to fill up with 64 bit values, returns how many values were returned
|
||||
NextMany64(hs uint64, buf []uint64) int
|
||||
}
|
||||
|
||||
type manyIntIterator struct {
|
||||
@@ -382,6 +384,25 @@ func (ii *manyIntIterator) NextMany(buf []uint32) int {
|
||||
return n
|
||||
}
|
||||
|
||||
func (ii *manyIntIterator) NextMany64(hs64 uint64, buf []uint64) int {
|
||||
n := 0
|
||||
for n < len(buf) {
|
||||
if ii.iter == nil {
|
||||
break
|
||||
}
|
||||
|
||||
hs := uint64(ii.hs) | hs64
|
||||
moreN := ii.iter.nextMany64(hs, buf[n:])
|
||||
n += moreN
|
||||
if moreN == 0 {
|
||||
ii.pos = ii.pos + 1
|
||||
ii.init()
|
||||
}
|
||||
}
|
||||
|
||||
return n
|
||||
}
|
||||
|
||||
func newManyIntIterator(a *Bitmap) *manyIntIterator {
|
||||
p := new(manyIntIterator)
|
||||
p.pos = 0
|
||||
@@ -678,7 +699,10 @@ func (rb *Bitmap) GetCardinality() uint64 {
|
||||
return size
|
||||
}
|
||||
|
||||
// Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be GetCardinality())
|
||||
// Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be GetCardinality()).
|
||||
// If you pass the smallest value, you get the value 1. If you pass a value that is smaller than the smallest
|
||||
// value, you get 0. Note that this function differs in convention from the Select function since it
|
||||
// return 1 and not 0 on the smallest value.
|
||||
func (rb *Bitmap) Rank(x uint32) uint64 {
|
||||
size := uint64(0)
|
||||
for i := 0; i < rb.highlowcontainer.size(); i++ {
|
||||
@@ -695,7 +719,9 @@ func (rb *Bitmap) Rank(x uint32) uint64 {
|
||||
return size
|
||||
}
|
||||
|
||||
// Select returns the xth integer in the bitmap
|
||||
// Select returns the xth integer in the bitmap. If you pass 0, you get
|
||||
// the smallest element. Note that this function differs in convention from
|
||||
// the Rank function which returns 1 on the smallest value.
|
||||
func (rb *Bitmap) Select(x uint32) (uint32, error) {
|
||||
if rb.GetCardinality() <= uint64(x) {
|
||||
return 0, fmt.Errorf("can't find %dth integer in a bitmap with only %d items", x, rb.GetCardinality())
|
||||
@@ -1555,3 +1581,7 @@ func (rb *Bitmap) Stats() Statistics {
|
||||
}
|
||||
return stats
|
||||
}
|
||||
|
||||
func (rb *Bitmap) FillLeastSignificant32bits(x []uint64, i uint64, mask uint64) {
|
||||
rb.ManyIterator().NextMany64(mask, x[i:])
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user