mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-11 23:33:00 +00:00
Rollup merge of #44559 - frewsxcv:frewsxcv-rm-loop, r=sfackler
Remove unneeded `loop`. None
This commit is contained in:
commit
19ad12af65
@ -1110,15 +1110,13 @@ impl<'a, T: Ord> Iterator for Union<'a, T> {
|
||||
type Item = &'a T;
|
||||
|
||||
fn next(&mut self) -> Option<&'a T> {
|
||||
loop {
|
||||
match cmp_opt(self.a.peek(), self.b.peek(), Greater, Less) {
|
||||
Less => return self.a.next(),
|
||||
Equal => {
|
||||
self.b.next();
|
||||
return self.a.next();
|
||||
}
|
||||
Greater => return self.b.next(),
|
||||
match cmp_opt(self.a.peek(), self.b.peek(), Greater, Less) {
|
||||
Less => self.a.next(),
|
||||
Equal => {
|
||||
self.b.next();
|
||||
self.a.next()
|
||||
}
|
||||
Greater => self.b.next(),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user