Skip to content

Commit

Permalink
code order tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
king6cong committed Feb 17, 2017
1 parent 668864d commit 860900c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libcore/iter/iterator.rs
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 860900c

Please sign in to comment.