|
|
@ -357,6 +357,7 @@ pub struct TransformRangeIter<'a> { |
|
|
|
end_it: TransformRangeEndIter<'a>, |
|
|
|
last_start: Option<(GeneratedAddress, RangeIndex)>, |
|
|
|
last_end: Option<(GeneratedAddress, RangeIndex)>, |
|
|
|
last_item: Option<(GeneratedAddress, GeneratedAddress)>, |
|
|
|
} |
|
|
|
|
|
|
|
impl<'a> TransformRangeIter<'a> { |
|
|
@ -371,6 +372,7 @@ impl<'a> TransformRangeIter<'a> { |
|
|
|
end_it, |
|
|
|
last_start, |
|
|
|
last_end, |
|
|
|
last_item: None, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -409,9 +411,6 @@ impl<'a> Iterator for TransformRangeIter<'a> { |
|
|
|
Some(range_start) => { |
|
|
|
// Consume start iterator.
|
|
|
|
self.last_start = self.start_it.next(); |
|
|
|
debug_assert!( |
|
|
|
self.last_start.is_none() || range_start < self.last_start.unwrap().0 |
|
|
|
); |
|
|
|
range_start |
|
|
|
} |
|
|
|
None => { |
|
|
@ -423,7 +422,6 @@ impl<'a> Iterator for TransformRangeIter<'a> { |
|
|
|
Some(range_end) => { |
|
|
|
// Consume end iterator.
|
|
|
|
self.last_end = self.end_it.next(); |
|
|
|
debug_assert!(self.last_end.is_none() || range_end < self.last_end.unwrap().0); |
|
|
|
range_end |
|
|
|
} |
|
|
|
None => { |
|
|
@ -432,6 +430,13 @@ impl<'a> Iterator for TransformRangeIter<'a> { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
if cfg!(debug_assertions) { |
|
|
|
match self.last_item.replace((range_start, range_end)) { |
|
|
|
Some((_, last_end)) => debug_assert!(last_end <= range_start), |
|
|
|
None => (), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if range_start < range_end { |
|
|
|
return Some((range_start, range_end)); |
|
|
|
} |
|
|
|