Merge recent update from ch7 && cargo clippy

This commit is contained in:
Yifan Wu 2022-01-22 12:32:36 -08:00
parent 737340b0a0
commit c9583b0f53
20 changed files with 236 additions and 163 deletions

View file

@ -17,7 +17,7 @@ pub struct Bitmap {
/// Return (block_pos, bits64_pos, inner_pos)
fn decomposition(mut bit: usize) -> (usize, usize, usize) {
let block_pos = bit / BLOCK_BITS;
bit = bit % BLOCK_BITS;
bit %= BLOCK_BITS;
(block_pos, bit / 64, bit % 64)
}
@ -70,4 +70,4 @@ impl Bitmap {
pub fn maximum(&self) -> usize {
self.blocks * BLOCK_BITS
}
}
}