refactor: simplify nested code
@@ -526,10 +526,20 @@ where
for (set_position, value) in &mut self.it {
loop {
let (idx_mask, included) = mask.next().expect("inclusion mask too short");
+
if !included {
self.exluded_count += 1;
}
- if idx_mask == set_position {
+
+ if idx_mask < set_position {
+ continue;
+ }
+ assert_eq!(
+ idx_mask, set_position,
+ "`idx_mask` ({}) should never jump over `set_position` ({}), this is a bug",
+ idx_mask, set_position
+ );
+
if *included {
let set_position = set_position
.checked_sub(self.exluded_count)
@@ -541,7 +551,6 @@ where
}
}
}
- }
None
} else {
