compiler/rust/bitset: Fix the bitset iterator
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32812>
This commit is contained in:
@@ -243,6 +243,7 @@ impl<'a> Iterator for BitSetIter<'a> {
|
||||
while self.w < self.set.words.len() {
|
||||
let b = (self.set.words[self.w] & self.mask).trailing_zeros();
|
||||
if b < 32 {
|
||||
self.mask &= !(1 << b);
|
||||
return Some(self.w * 32 + usize::try_from(b).unwrap());
|
||||
}
|
||||
self.mask = u32::MAX;
|
||||
|
Reference in New Issue
Block a user