Skip to content

Commit

Permalink
Remove unneeded loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Sep 14, 2017
1 parent 9421141 commit 2d292cf
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/liballoc/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}

Expand Down

0 comments on commit 2d292cf

Please sign in to comment.