Skip to content

Commit 4fe1f0a

Browse files
authored
Merge pull request #479 from amikai/doc-iterator
docs: add godoc for Values and Backward
2 parents 6d5d9b0 + 943a6f2 commit 4fe1f0a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

iter.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package roaring
22

3+
// Values returns an iterator that yields the elements of the bitmap in
4+
// increasing order. Starting with Go 1.23, users can use a for loop to iterate
5+
// over it.
36
func Values(b *Bitmap) func(func(uint32) bool) {
47
return func(yield func(uint32) bool) {
58
it := b.Iterator()
@@ -11,6 +14,9 @@ func Values(b *Bitmap) func(func(uint32) bool) {
1114
}
1215
}
1316

17+
// Backward returns an iterator that yields the elements of the bitmap in
18+
// decreasing order. Starting with Go 1.23, users can use a for loop to iterate
19+
// over it.
1420
func Backward(b *Bitmap) func(func(uint32) bool) {
1521
return func(yield func(uint32) bool) {
1622
it := b.ReverseIterator()

roaring64/iter.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package roaring64
22

3+
// Values returns an iterator that yields the elements of the bitmap in
4+
// increasing order. Starting with Go 1.23, users can use a for loop to iterate
5+
// over it.
36
func Values(b *Bitmap) func(func(uint64) bool) {
47
return func(yield func(uint64) bool) {
58
it := b.Iterator()
@@ -11,6 +14,9 @@ func Values(b *Bitmap) func(func(uint64) bool) {
1114
}
1215
}
1316

17+
// Backward returns an iterator that yields the elements of the bitmap in
18+
// decreasing order. Starting with Go 1.23, users can use a for loop to iterate
19+
// over it.
1420
func Backward(b *Bitmap) func(func(uint64) bool) {
1521
return func(yield func(uint64) bool) {
1622
it := b.ReverseIterator()

0 commit comments

Comments
 (0)