From f121d7e7e9b69c2f132946a42aae874dd304ef8b Mon Sep 17 00:00:00 2001 From: lrleon Date: Sat, 20 Mar 2021 15:12:23 -0500 Subject: [PATCH] Added method ResetFirst() for compliance with functional library --- slist.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/slist.go b/slist.go index 6d17e25..dc27758 100644 --- a/slist.go +++ b/slist.go @@ -170,6 +170,12 @@ func (seq *Slist) CreateIterator() interface{} { return NewIterator(seq) } +func (it *Iterator) ResetFirst() interface{} { + + it.curr = it.listPtr.head + return it +} + func (it *Iterator) HasCurr() bool { return it.curr != nil }