Skip to content

Commit

Permalink
Rollup merge of rust-lang#44559 - frewsxcv:frewsxcv-rm-loop, r=sfackler
Browse files Browse the repository at this point in the history
Remove unneeded `loop`.

None
  • Loading branch information
frewsxcv authored Sep 15, 2017
2 parents ffd286b + 2d292cf commit 19ad12a
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 19ad12a

Please sign in to comment.