Skip to content

Commit

Permalink
optimize on error
Browse files Browse the repository at this point in the history
  • Loading branch information
makiuchi-d committed Sep 3, 2024
1 parent 7986380 commit 7492976
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions iter.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ func iterAll[T any, E Enumerator[T]](e E) iter.Seq2[T, error] {
if isEOC(err) {
return
}
}

if !yield(v, err) {
yield(v, err)
return
}

if err != nil {
if !yield(v, nil) {
return
}
}
Expand Down

0 comments on commit 7492976

Please sign in to comment.