mirror of
https://github.com/topjohnwu/cxx.git
synced 2025-02-22 00:54:33 +00:00
Simplify CxxVector iterator next method
This commit is contained in:
parent
cbf0964a7c
commit
0d52717355
@ -158,9 +158,9 @@ where
|
||||
type Item = &'a T;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
let next = self.v.get(self.index);
|
||||
self.index += next.is_some() as usize;
|
||||
next
|
||||
let next = self.v.get(self.index)?;
|
||||
self.index += 1;
|
||||
Some(next)
|
||||
}
|
||||
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user