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) }