From 4f3cf3f537b5d425bc0cbb61b5468cf3eb77e3af Mon Sep 17 00:00:00 2001 From: Timon Ringwald Date: Sun, 28 Aug 2022 15:03:40 +0200 Subject: [PATCH] removed channel dependency --- go.mod | 4 +--- slices.go | 12 ------------ 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 52ff837..53fb616 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,3 @@ module git.milar.in/milarin/slices -go 1.19 - -require git.milar.in/milarin/channel v0.0.7 +go 1.19 \ No newline at end of file diff --git a/slices.go b/slices.go index 171b184..0d413e0 100644 --- a/slices.go +++ b/slices.go @@ -1,9 +1,5 @@ package slices -import ( - "git.milar.in/milarin/channel" -) - func IndexOf[T comparable](slice []T, value T) int { return IndexOfCmp(slice, value, DefaultEqualityComparator[T]) } @@ -33,14 +29,6 @@ func Map[I, O any](slice []I, mapper func(I) O) []O { return ret } -func MapParallel[I, O any](slice []I, mapper func(I) O) []O { - return channel.ToSlice(channel.Map(channel.Of(slice...), mapper)) -} - -func MapParallelWithRunner[I, O any](slice []I, runner channel.Runner, mapper func(I) O) []O { - return channel.ToSlice(channel.MapWithRunner(channel.Of(slice...), runner, mapper)) -} - func Each[T any](slice []T, f func(T)) { EachIndex(slice, func(_ int, v T) { f(v) }) }