Open grelner opened 3 months ago
Hi sorry for the slow progress, I've been on vacation too. I've pushed some changes and I think it's ready for review now. This implements:
@Kerollmops sorry this 1.66 requirement keeps tripping me up. I pushed a fix for it now. Maybe that should be added to https://github.com/RoaringBitmap/roaring-rs?tab=readme-ov-file#developing
bench-skip_to.txt cargo bench iteration results of the branch
@Kerollmops any chance to get this reviewed and hopefully merged?
@Kerollmops did you change something in CI? It's failing on parts of the code I never touched
Hey @grelner š It's may be due to https://github.com/RoaringBitmap/roaring-rs/pull/293, would you mind rebasing on main? š¤
Hey @grelner š
It seems the CI is complaining about missing documentation on some macros, would mind adding the doc in a dedicated commit and rebase on main now that I merged #295, please?
Have a nice day š
Similar to #290, I think I have a good idea of basically exactly what I'd want this implementation to look like, let me know if you'd rather I finish this off. I know there's been a lot of back and forth on this already (add the size hint, now remove the size hint)
Hi @Dr-Emann , thanks for the feedback! I'm hilariously busy at the moment and unfortunately won't have time to work on this for at least 2-3 weeks so feel free to finish up. If not I'm happy to do it when I have some time again
This is the start of the implementation of #286 . It adds a new trait
SkipTo
which for now is only implemented for iter::Iter.The
SkipTo
trait contains a methodskip_to(&mut self, n:u32)
which should return anIterator
that yields values >=n
. The implementation foriter::Iter
achieves this by doing a binary search for the correct container, and then another binary search if the container is anArrayStore
, or forwarding like a normalBitmapIter
until a suitable value is found forBitmapStore
.Right now
SkipTo
is implemented foriter::Iter
, but I don't think this is semantically sound, and it should probably rather be implemented forRoaringBitmap
. In the discussion for #286 @Kerollmops wanted a similar api toSkipWhile
, but this does not really fit, asSkipWhile
can perform it's operation only using an existing iterator, but this is not true forSkipTo
, as it needs direct access to the containers to do it's skip efficiently, not only the existing iterator. A reference to the container vec has been added toiter::Iter
only for this purpose. Theiterator
returned is fully independent, and not related to the iterator on which theskip_to
call was made at all.This PR in it's current state implements what I need for my project, but I would like to finish it, albeit at a slightly slower pace.