mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
parallel/slice.go GroupBy
reduce number of reads
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user