We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7711768 commit c3f7d46Copy full SHA for c3f7d46
src/raw/bitmask.rs
@@ -32,7 +32,8 @@ impl BitMask {
32
#[allow(clippy::cast_ptr_alignment)]
33
#[cfg(feature = "raw")]
34
pub unsafe fn flip(&mut self, index: usize) -> bool {
35
- let mask = 1 << (index * BITMASK_STRIDE);
+ // NOTE: The + BITMASK_STRIDE - 1 is to set the high bit.
36
+ let mask = 1 << (index * BITMASK_STRIDE + BITMASK_STRIDE - 1);
37
self.0 ^= mask;
38
// The bit was set if the bit is now 0.
39
self.0 & mask == 0
0 commit comments