mirror of
https://github.com/bloeys/nmage.git
synced 2025-12-29 13:28:20 +00:00
Fix iterator bug in Nex()
This commit is contained in:
@ -45,9 +45,10 @@ func (it *Iterator[T]) Next() (*T, Handle) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
it.remainingItems--
|
item := &it.registry.Items[it.currIndex]
|
||||||
it.currIndex++
|
it.currIndex++
|
||||||
return &it.registry.Items[it.currIndex], handle
|
it.remainingItems--
|
||||||
|
return item, handle
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we reached here means we iterated to the end and didn't find anything, which probably
|
// If we reached here means we iterated to the end and didn't find anything, which probably
|
||||||
|
|||||||
Reference in New Issue
Block a user