roaring icon indicating copy to clipboard operation
roaring copied to clipboard

Add support for Go1.23+ iterators

Open lemire opened this issue 10 months ago • 4 comments

When Go 1.23 or better is available, we can streamline the iterators...

for i := range b.EachSet() {}

See https://github.com/bits-and-blooms/bitset/blob/master/bitset_iter.go

lemire avatar Feb 25 '25 19:02 lemire

New to contribution for this project, could you please elaborate on this to see if I can contribute?

krishnaindani avatar Feb 26 '25 05:02 krishnaindani

@krishnaindani Yes, that would be a great contribution.

So first examine how it is implemented in bitset:

https://github.com/bits-and-blooms/bitset/blob/master/bitset_iter.go

Then look at how iterators work in roaring... see https://github.com/RoaringBitmap/roaring/blob/773047c1e89d9cb7ed45d712e13db65945b6b5db/README.md?plain=1#L225-L230

The idea is to wrap our iterators into an iter function.

It is not trivial but I think it is also not too difficult.

lemire avatar Feb 26 '25 13:02 lemire

Thank you, I will go through it and post any questions here.

krishnaindani avatar Feb 27 '25 02:02 krishnaindani

@krishnaindani Please do.

lemire avatar Feb 27 '25 13:02 lemire