-
Notifications
You must be signed in to change notification settings - Fork 84
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
Non panicking push method #99
Conversation
e13c4cb
to
0324b7b
Compare
Thank you very much 😺 bors try |
tryBuild failed: |
0324b7b
to
b179d25
Compare
sorry, forgot to run fmt. fixed now :) |
tryBuild failed: |
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.
Could you please fixup (with only one commit message) the first three commits, please?
Keep the clippy fixes in one separate commit.
👊 |
fcac350
to
0fa6be0
Compare
d2085ac
to
1d7088e
Compare
optimize push and fix correctness min returns option
1d7088e
to
d3ba299
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.
Thank you, LGTM!
bors merge
Build succeeded: |
106: Modify the from_sorted_iter and append methods to return a Result r=Kerollmops a=Kerollmops This PR fixes #103, which means that the `from_sorted_iter` and `append` methods of the `RoaringBit/Treemap` types now return a `Result`. The `Err` value corresponds to the number of values that we appended to the set until we found an erroneous value, it eases debugging. These two methods were containing bugs in the sense that they were silently discarding invalid values instead of panicking, this bug was introduced by #99 which introduced a non-panicking push method. A possible improvement could be to introduce a new error type, something like a `NonSortedIntegers` struct with a `stopped_at`/`valid_until` method that returns the `u64` we currently return as the `Err`. `@MarinPostma` could you please take a look at this PR? If you got the time? Co-authored-by: Kerollmops <clement@meilisearch.com> Co-authored-by: Clément Renault <renault.cle@gmail.com>
99: Non panicking push method r=Kerollmops a=MarinPostma Changes the `push` method to make it not panic when inserting a value that is not greater than the previous. Also make some optimizations that make the push method roughly 20% faster than before. Co-authored-by: Clément Renault <clement@meilisearch.com>
106: Modify the from_sorted_iter and append methods to return a Result r=Kerollmops a=Kerollmops This PR fixes RoaringBitmap#103, which means that the `from_sorted_iter` and `append` methods of the `RoaringBit/Treemap` types now return a `Result`. The `Err` value corresponds to the number of values that we appended to the set until we found an erroneous value, it eases debugging. These two methods were containing bugs in the sense that they were silently discarding invalid values instead of panicking, this bug was introduced by RoaringBitmap#99 which introduced a non-panicking push method. A possible improvement could be to introduce a new error type, something like a `NonSortedIntegers` struct with a `stopped_at`/`valid_until` method that returns the `u64` we currently return as the `Err`. `@MarinPostma` could you please take a look at this PR? If you got the time? Co-authored-by: Kerollmops <clement@meilisearch.com> Co-authored-by: Clément Renault <renault.cle@gmail.com>
Changes the
push
method to make it not panic when inserting a value that is not greater than the previous. Also make some optimizations that make the push method roughly 20% faster than before.