Skip to content

Commit

Permalink
Rollup merge of #39898 - king6cong:logic_clean, r=alexcrichton
Browse files Browse the repository at this point in the history
code order tweak
  • Loading branch information
GuillaumeGomez authored Feb 17, 2017
2 parents 6ed7413 + 860900c commit aedaa98
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libcore/iter/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1603,12 +1603,12 @@ pub trait Iterator {
let mut i = self.len();

while let Some(v) = self.next_back() {
if predicate(v) {
return Some(i - 1);
}
// No need for an overflow check here, because `ExactSizeIterator`
// implies that the number of elements fits into a `usize`.
i -= 1;
if predicate(v) {
return Some(i);
}
}
None
}
Expand Down

0 comments on commit aedaa98

Please sign in to comment.