iter-list.go -> list-iterator.go

Fix: the reset command set the initial item to the second one in the list
This commit is contained in:
Celestino Amoroso 2024-07-11 05:52:47 +02:00
parent 3ebba83bce
commit a73d24b171

View File

@ -1,7 +1,7 @@
// Copyright (c) 2024 Celestino Amoroso (celestino.amoroso@gmail.com). // Copyright (c) 2024 Celestino Amoroso (celestino.amoroso@gmail.com).
// All rights reserved. // All rights reserved.
// iter-list.go // list-iterator.go
package expr package expr
import ( import (
@ -140,6 +140,6 @@ func (it *ListIterator) Index() int {
} }
func (it *ListIterator) Reset() (bool, error) { func (it *ListIterator) Reset() (bool, error) {
it.index = it.start it.index = it.start - it.step
return true, nil return true, nil
} }