Skip to content

Commit

Permalink
delayed execution
Browse files Browse the repository at this point in the history
  • Loading branch information
makiuchi-d committed Sep 16, 2024
1 parent ffbf93f commit e2b428d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions iter.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

// All returns an iterator function
func (e Enumerable[T]) All() iter.Seq2[T, error] {
er := e()
return func(yield func(T, error) bool) {
er := e()
for {
v, err := er.Next()
if err != nil {
Expand All @@ -30,8 +30,8 @@ func (e Enumerable[T]) All() iter.Seq2[T, error] {

// All returns an iterator function
func (e OrderedEnumerable[T]) All() iter.Seq2[T, error] {
er := e()
return func(yield func(T, error) bool) {
er := e()
for {
v, err := er.Next()
if err != nil {
Expand Down

0 comments on commit e2b428d

Please sign in to comment.