Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions iter.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package roaring

// 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) func(func(uint32) bool) {
return func(yield func(uint32) bool) {
it := b.Iterator()
Expand All @@ -11,6 +14,9 @@ func Values(b *Bitmap) func(func(uint32) bool) {
}
}

// 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) func(func(uint32) bool) {
return func(yield func(uint32) bool) {
it := b.ReverseIterator()
Expand Down
6 changes: 6 additions & 0 deletions roaring64/iter.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package roaring64

// 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) func(func(uint64) bool) {
return func(yield func(uint64) bool) {
it := b.Iterator()
Expand All @@ -11,6 +14,9 @@ func Values(b *Bitmap) func(func(uint64) bool) {
}
}

// 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) func(func(uint64) bool) {
return func(yield func(uint64) bool) {
it := b.ReverseIterator()
Expand Down
Loading