File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -303,10 +303,15 @@ impl BitmapStore {
303303 & self . bits
304304 }
305305
306+ pub fn clear ( & mut self ) {
307+ self . bits . fill ( 0 ) ;
308+ self . len = 0 ;
309+ }
310+
306311 /// Set N bits that are currently 1 bit from the lower bit to 0.
307312 pub fn remove_front ( & mut self , mut clear_bits : u64 ) {
308313 if self . len ( ) < clear_bits {
309- * self = Self :: default ( ) ;
314+ self . clear ( ) ;
310315 return ;
311316 }
312317 self . len -= clear_bits as u64 ;
@@ -337,7 +342,7 @@ impl BitmapStore {
337342 /// Set N bits that are currently 1 bit from the lower bit to 0.
338343 pub fn remove_back ( & mut self , mut clear_bits : u64 ) {
339344 if self . len ( ) < clear_bits {
340- * self = Self :: default ( ) ;
345+ self . clear ( ) ;
341346 return ;
342347 }
343348 self . len -= clear_bits;
You can’t perform that action at this time.
0 commit comments