style: unneeded else
This commit is contained in:
@@ -41,10 +41,11 @@ func (i Iterator[T]) Peek() (T, error) {
|
|||||||
// Moves the iterator pointer to the next item. Returns the current item. Fails
|
// Moves the iterator pointer to the next item. Returns the current item. Fails
|
||||||
// if there are no more items to iterate over.
|
// if there are no more items to iterate over.
|
||||||
func (i *Iterator[T]) Next() (T, error) {
|
func (i *Iterator[T]) Next() (T, error) {
|
||||||
if val, err := i.Peek(); err != nil {
|
val, err := i.Peek()
|
||||||
|
if err != nil {
|
||||||
return val, err
|
return val, err
|
||||||
} else {
|
}
|
||||||
|
|
||||||
i.index++
|
i.index++
|
||||||
return val, nil
|
return val, nil
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user