Rollup merge of #39898 - king6cong:logic_clean, r=alexcrichton

code order tweak
This commit is contained in:
Guillaume Gomez 2017-02-18 18:10:13 +01:00 committed by GitHub
commit 33d1346588
1 changed files with 3 additions and 3 deletions

View File

@ -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
}