Commit deaa66f 1 parent d0e7322 commit deaa66f Copy full SHA for deaa66f
File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -303,10 +303,15 @@ impl BitmapStore {
303
303
& self . bits
304
304
}
305
305
306
+ pub fn clear ( & mut self ) {
307
+ self . bits . fill ( 0 ) ;
308
+ self . len = 0 ;
309
+ }
310
+
306
311
/// Set N bits that are currently 1 bit from the lower bit to 0.
307
312
pub fn remove_front ( & mut self , mut clear_bits : u64 ) {
308
313
if self . len ( ) < clear_bits {
309
- * self = Self :: default ( ) ;
314
+ self . clear ( ) ;
310
315
return ;
311
316
}
312
317
self . len -= clear_bits as u64 ;
@@ -337,7 +342,7 @@ impl BitmapStore {
337
342
/// Set N bits that are currently 1 bit from the lower bit to 0.
338
343
pub fn remove_back ( & mut self , mut clear_bits : u64 ) {
339
344
if self . len ( ) < clear_bits {
340
- * self = Self :: default ( ) ;
345
+ self . clear ( ) ;
341
346
return ;
342
347
}
343
348
self . len -= clear_bits;
You can’t perform that action at this time.
0 commit comments