removed channel dependency
This commit is contained in:
parent
2124bff9de
commit
4f3cf3f537
2
go.mod
2
go.mod
@ -1,5 +1,3 @@
|
||||
module git.milar.in/milarin/slices
|
||||
|
||||
go 1.19
|
||||
|
||||
require git.milar.in/milarin/channel v0.0.7
|
||||
|
12
slices.go
12
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) })
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user