Reset() and Clean() have new, simpler signature

This commit is contained in:
2024-09-12 05:44:29 +02:00
parent ad3c1e5a60
commit d215d837f6
4 changed files with 18 additions and 6 deletions
+9 -3
View File
@@ -99,7 +99,9 @@ func (it *ListIterator) CallOperation(name string, args map[string]any) (v any,
case NextName:
v, err = it.Next()
case ResetName:
v, err = it.Reset()
err = it.Reset()
case CleanName:
err = it.Clean()
case IndexName:
v = int64(it.Index())
case CurrentName:
@@ -147,8 +149,12 @@ func (it *ListIterator) Count() int {
return it.count
}
func (it *ListIterator) Reset() (bool, error) {
func (it *ListIterator) Reset() (error) {
it.index = it.start - it.step
it.count = 0
return true, nil
return nil
}
func (it *ListIterator) Clean() (error) {
return nil
}