code order tweak
This commit is contained in:
parent
668864d9ed
commit
860900cfc3
@ -1603,12 +1603,12 @@ fn rposition<P>(&mut self, mut predicate: P) -> Option<usize> where
|
|||||||
let mut i = self.len();
|
let mut i = self.len();
|
||||||
|
|
||||||
while let Some(v) = self.next_back() {
|
while let Some(v) = self.next_back() {
|
||||||
if predicate(v) {
|
|
||||||
return Some(i - 1);
|
|
||||||
}
|
|
||||||
// No need for an overflow check here, because `ExactSizeIterator`
|
// No need for an overflow check here, because `ExactSizeIterator`
|
||||||
// implies that the number of elements fits into a `usize`.
|
// implies that the number of elements fits into a `usize`.
|
||||||
i -= 1;
|
i -= 1;
|
||||||
|
if predicate(v) {
|
||||||
|
return Some(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user