Skip to content

Commit 279a5b3

Browse files
committed
Clear ChunkedBitSet without reallocating
1 parent 2300c2a commit 279a5b3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/rustc_index/src/bit_set.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,7 @@ impl<T: Idx> ChunkedBitSet<T> {
585585
}
586586

587587
pub fn clear(&mut self) {
588-
let domain_size = self.domain_size();
589-
*self = ChunkedBitSet::new_empty(domain_size);
588+
self.chunks.fill_with(|| Chunk::Zeros);
590589
}
591590

592591
#[cfg(test)]

0 commit comments

Comments
 (0)