Use a bitset instead of a hash map in HIR ID validator
This commit is contained in:
parent
8c52a83c45
commit
2a57e5efed
2 changed files with 14 additions and 4 deletions
|
@ -1546,6 +1546,16 @@ impl<T: Idx> GrowableBitSet<T> {
|
|||
let (word_index, mask) = word_index_and_mask(elem);
|
||||
self.bit_set.words.get(word_index).map_or(false, |word| (word & mask) != 0)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn iter(&self) -> BitIter<'_, T> {
|
||||
self.bit_set.iter()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn len(&self) -> usize {
|
||||
self.bit_set.count()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Idx> From<BitSet<T>> for GrowableBitSet<T> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue