We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d0e7322 commit deaa66fCopy full SHA for deaa66f
src/bitmap/store/bitmap_store.rs
@@ -303,10 +303,15 @@ impl BitmapStore {
303
&self.bits
304
}
305
306
+ pub fn clear(&mut self) {
307
+ self.bits.fill(0);
308
+ self.len = 0;
309
+ }
310
+
311
/// Set N bits that are currently 1 bit from the lower bit to 0.
312
pub fn remove_front(&mut self, mut clear_bits: u64) {
313
if self.len() < clear_bits {
- *self = Self::default();
314
+ self.clear();
315
return;
316
317
self.len -= clear_bits as u64;
@@ -337,7 +342,7 @@ impl BitmapStore {
337
342
338
343
pub fn remove_back(&mut self, mut clear_bits: u64) {
339
344
340
345
341
346
347
348
self.len -= clear_bits;
0 commit comments