Rollup merge of #44559 - frewsxcv:frewsxcv-rm-loop, r=sfackler

Remove unneeded `loop`.

None
This commit is contained in:
Corey Farwell 2017-09-14 22:32:49 -04:00 committed by GitHub
commit 19ad12af65

View File

@ -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(),
}
}