parallel/slice.go GroupBy

reduce number of reads
This commit is contained in:
Sergey Dobrodey
2022-03-25 17:30:35 +02:00
committed by GitHub
parent 62b3831d15
commit f09091140d
-4
View File
@@ -80,10 +80,6 @@ func GroupBy[T any, U comparable](collection []T, iteratee func(T) U) map[U][]T
mu.Lock()
if _, ok := result[key]; !ok {
result[key] = []T{}
}
result[key] = append(result[key], _item)
mu.Unlock()