There was an error while loading. Please reload this page.
ChunkedBitSet
1 parent 2300c2a commit 9ff52bfCopy full SHA for 9ff52bf
1 file changed
compiler/rustc_index/src/bit_set.rs
@@ -585,8 +585,7 @@ impl<T: Idx> ChunkedBitSet<T> {
585
}
586
587
pubfnclear(&mutself){
588
-let domain_size = self.domain_size();
589
-*self = ChunkedBitSet::new_empty(domain_size);
+self.chunks.fill_with(|| Chunk::Zeros);
590
591
592
#[cfg(test)]
@@ -684,9 +683,7 @@ impl<T: Idx> ChunkedBitSet<T> {
684
683
685
/// Sets all bits to true.
686
pubfninsert_all(&mutself){
687
-for chunk inself.chunks.iter_mut(){
688
-*chunk = Ones;
689
-}
+self.chunks.fill_with(|| Chunk::Ones);
690
691
692
/// Returns `true` if the set has changed.
0 commit comments