-
Notifications
You must be signed in to change notification settings - Fork 107
[bitmap] remove invariant that last chunk has room for next bit #1589
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
base: danlaine/separate-bitmap
Are you sure you want to change the base?
[bitmap] remove invariant that last chunk has room for next bit #1589
Conversation
Can you clarify why this is desirable? It seems to be adding complexity (albeit not much). The "this comment" link in the PR description doesn't work from me (perhaps because I'm using the "new" github UI?) |
/// The position within the last chunk where the next bit is to be appended. | ||
/// | ||
/// Invariant: This value is always in the range [0, N * 8). | ||
/// Invariant: If chunks.is_empty(), then next_bit == 0. |
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.
this increase in invariant complexity makes me a little sad
It's a link to @BrendanChou's comment that reads:
Sounds like there's disagreement as to which invariant is simpler. I'm not especially opinionated. I suppose I slightly favor this PR's approach because it makes serialization more straightforward. Namely, you don't need to worry about serializing an empty chunk at the end of the bitmap. |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## danlaine/separate-bitmap #1589 +/- ##
===========================================================
Coverage ? 92.29%
===========================================================
Files ? 295
Lines ? 76250
Branches ? 0
===========================================================
Hits ? 70375
Misses ? 5875
Partials ? 0
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Follow up PR to #1516 based on this comment.
This PR removes the invariant that the bitmap has at least 1 chunk.
This requires corresponding changes in
adb::current::Current
, which uses theBitMap
.