-
Notifications
You must be signed in to change notification settings - Fork 92
Introduce Iter::next_range and next_range_back #338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
282e13e to
7499198
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces new methods next_range and next_range_back to the Iter and IntoIter types for RoaringBitmap, enabling extraction of consecutive ranges of set bits from iterators rather than individual values.
- Implementation of range extraction methods across all container types (array, bitmap, run)
- Helper functions for finding contiguous ranges in array stores
- Comprehensive test coverage including edge cases and multi-container scenarios
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| roaring/tests/iter_next_range.rs | Comprehensive test suite covering various scenarios for the new range methods |
| roaring/src/bitmap/iter.rs | Main implementation of next_range and next_range_back methods for public iterators |
| roaring/src/bitmap/container.rs | Container-level wrapper methods that delegate to store implementations |
| roaring/src/bitmap/store/mod.rs | Store iterator wrapper that dispatches to specific store implementations |
| roaring/src/bitmap/store/array_store/mod.rs | Helper functions for finding contiguous ranges in sorted arrays |
| roaring/src/bitmap/store/bitmap_store.rs | Bitmap store implementation with bit manipulation for range extraction |
| roaring/src/bitmap/store/interval_store.rs | Run store implementation using interval-based range extraction |
| fuzz/fuzz_targets/arbitrary_ops/mod.rs | Fuzz testing support for the new range methods |
7499198 to
f5d790c
Compare
Provide an optimal way to iterate over the ranges of a bitmap
f5d790c to
7bf690c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good to me. Have you run the fuzzer for more than 30 minutes in the CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you for your work, again 👌
closes #274