diff options
Diffstat (limited to 'vendor/rustc-rayon/src/iter/interleave.rs')
-rw-r--r-- | vendor/rustc-rayon/src/iter/interleave.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/vendor/rustc-rayon/src/iter/interleave.rs b/vendor/rustc-rayon/src/iter/interleave.rs index b5d43d53d..3cacc49f9 100644 --- a/vendor/rustc-rayon/src/iter/interleave.rs +++ b/vendor/rustc-rayon/src/iter/interleave.rs @@ -310,16 +310,16 @@ where { #[inline] fn next_back(&mut self) -> Option<I::Item> { - if self.i.len() == self.j.len() { - if self.i_next { - self.i.next_back() - } else { - self.j.next_back() + match self.i.len().cmp(&self.j.len()) { + Ordering::Less => self.j.next_back(), + Ordering::Equal => { + if self.i_next { + self.i.next_back() + } else { + self.j.next_back() + } } - } else if self.i.len() < self.j.len() { - self.j.next_back() - } else { - self.i.next_back() + Ordering::Greater => self.i.next_back(), } } } |