From 117fe3a56318a9d402fb580793437d4908c55be1 Mon Sep 17 00:00:00 2001 From: a Date: Sun, 27 Mar 2022 01:18:21 +0000 Subject: [PATCH] Update 'parallel/map.go' --- parallel/map.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parallel/map.go b/parallel/map.go index f174048..33e5509 100644 --- a/parallel/map.go +++ b/parallel/map.go @@ -20,14 +20,14 @@ func Map[T any](xs []T, fx func(T) T) []T { return lambda.Flatten(spl) } -func MapV[T, V any](xs []T, fx func(T) T) []V { +func MapV[T, V any](xs []T, fx func(T) V) []V { spl := lambda.Split(xs, routineCount) wg := new(sync.WaitGroup) wg.Add(len(spl)) tmp := make([][]V, len(spl)) for i, v := range spl { go func(ix int, vx []T) { - spl[ix] = lambda.Map(vx, fx) + spl[ix] = lambda.MapV(vx, fx) wg.Done() }(i, v) }