diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-09-13 22:44:14 -0400 |
|---|---|---|
| committer | Corey Farwell <coreyf@rwell.org> | 2017-09-13 22:44:14 -0400 |
| commit | 2d292cff5d0a1f8e3273879477553bb8717b6f78 (patch) | |
| tree | b8efbdc36f3e2e7faf0178fa86ddbb39166bd7b8 /src/liballoc/btree | |
| parent | 94211416bcde4d1049f241b6c95594e28c8865e6 (diff) | |
| download | rust-2d292cff5d0a1f8e3273879477553bb8717b6f78.tar.gz rust-2d292cff5d0a1f8e3273879477553bb8717b6f78.zip | |
Remove unneeded `loop`.
Diffstat (limited to 'src/liballoc/btree')
| -rw-r--r-- | src/liballoc/btree/set.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/liballoc/btree/set.rs b/src/liballoc/btree/set.rs index d32460da939..7da6371cc19 100644 --- a/src/liballoc/btree/set.rs +++ b/src/liballoc/btree/set.rs @@ -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(), } } |
