Skip to content

Commit

Permalink
Merge pull request #41 from meian/refactor-slice
Browse files Browse the repository at this point in the history
To inline Iterator
  • Loading branch information
meian authored Jan 19, 2022
2 parents 5eebba8 + 374652c commit ad5b511
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ func ToSlice[T any](itb Iterable[T]) []T {
return append(ss, sitb.slice...)
}
s := make([]T, 0)
it := itb.Iterator()
for it.MoveNext() {
for it := itb.Iterator(); it.MoveNext(); {
s = append(s, it.Current())
}
return s
Expand Down

0 comments on commit ad5b511

Please sign in to comment.