bug fix of bitmap constructor
This commit is contained in:
parent
1da8b8465f
commit
60410efd1a
@ -20,15 +20,13 @@ impl BitMap {
|
||||
/// ### Parameters
|
||||
/// - **nitems** is the number of bits in the bitmap.
|
||||
///----------------------------------------------------------------------
|
||||
pub fn init_bitmap(&self, n_items: usize) -> BitMap {
|
||||
pub fn init_bitmap(n_items: usize) -> BitMap {
|
||||
let mut tmp: Vec<u32>;
|
||||
BitMap{
|
||||
num_bits: n_items,
|
||||
num_words: (n_items + SECTOR_SIZE as usize -1) / SECTOR_SIZE as usize,
|
||||
map: tmp,
|
||||
};
|
||||
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
/// Set the "nth" bit in a bitmap.
|
||||
|
Loading…
x
Reference in New Issue
Block a user