perf(slice): make the IndexOf function thread-safe (#263)

This commit is contained in:
残念 authored and GitHub committed 2024-11-06 10:04:44 +08:00
1 parent 8bbae69175
commit a7fecfc73b
3 files changed
+64 -6

No files matched your search

+1 -1
View File
@@ -149,7 +149,7 @@ func FilterConcurrent[T any](slice []T, predicate func(index int, item T) bool,
return result
}
// UniqueByParallel removes duplicate elements from the slice by parallel
// UniqueByConcurrent removes duplicate elements from the slice by parallel
// The comparator function is used to compare the elements
// The numThreads parameter specifies the number of threads to use
// If numThreads is less than or equal to 0, it will be set to 1