mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-06-17 12:28:57 -04:00
Bumps [github.com/blevesearch/bleve/v2](https://github.com/blevesearch/bleve) from 2.5.7 to 2.6.0. - [Release notes](https://github.com/blevesearch/bleve/releases) - [Commits](https://github.com/blevesearch/bleve/compare/v2.5.7...v2.6.0) --- updated-dependencies: - dependency-name: github.com/blevesearch/bleve/v2 dependency-version: 2.6.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
45 lines
1.1 KiB
Go
45 lines
1.1 KiB
Go
package roaring
|
|
|
|
import "iter"
|
|
|
|
// Values returns an iterator that yields the elements of the bitmap in
|
|
// increasing order. Starting with Go 1.23, users can use a for loop to iterate
|
|
// over it.
|
|
func Values(b *Bitmap) iter.Seq[uint32] {
|
|
return func(yield func(uint32) bool) {
|
|
it := b.Iterator()
|
|
for it.HasNext() {
|
|
if !yield(it.Next()) {
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Backward returns an iterator that yields the elements of the bitmap in
|
|
// decreasing order. Starting with Go 1.23, users can use a for loop to iterate
|
|
// over it.
|
|
func Backward(b *Bitmap) iter.Seq[uint32] {
|
|
return func(yield func(uint32) bool) {
|
|
it := b.ReverseIterator()
|
|
for it.HasNext() {
|
|
if !yield(it.Next()) {
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Unset creates an iterator that yields values in the range [min, max] that are NOT contained in the bitmap.
|
|
// The iterator becomes invalid if the bitmap is modified (e.g., with Add or Remove).
|
|
func Unset(b *Bitmap, min, max uint32) iter.Seq[uint32] {
|
|
return func(yield func(uint32) bool) {
|
|
it := b.UnsetIterator(uint64(min), uint64(max)+1)
|
|
for it.HasNext() {
|
|
if !yield(it.Next()) {
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|