Skip to content

Commit 60a0a07

Browse files
committed
bugfix: change LazyOffsetArrayIter16 to ignore null offsets
1 parent 6e75b3c commit 60a0a07

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/parser.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,12 +651,15 @@ impl<'a, T: FromSlice<'a>> Iterator for LazyOffsetArrayIter16<'a, T> {
651651
type Item = T;
652652

653653
fn next(&mut self) -> Option<Self::Item> {
654-
if self.index < self.array.len() {
654+
while self.index < self.array.len() {
655655
self.index += 1;
656-
self.array.get(self.index - 1)
657-
} else {
658-
None
656+
match self.array.get(self.index - 1) {
657+
None => {}
658+
s => return s,
659+
}
659660
}
661+
662+
None
660663
}
661664

662665
#[inline]

0 commit comments

Comments
 (0)