Skip to content

Commit

Permalink
Added method ResetFirst() for compliance with functional library
Browse files Browse the repository at this point in the history
  • Loading branch information
lrleon committed Mar 20, 2021
1 parent 2bb36b6 commit f121d7e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions slist.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f121d7e

Please sign in to comment.