From 374652cf8742e738e06b0d643b3629b03f83f383 Mon Sep 17 00:00:00 2001 From: kitamin <11195207+meian@users.noreply.github.com> Date: Thu, 20 Jan 2022 02:11:02 +0900 Subject: [PATCH] To inline Iterator --- slice.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/slice.go b/slice.go index f4246d1..b3d9adf 100644 --- a/slice.go +++ b/slice.go @@ -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