performance

This commit is contained in:
adman
2026-03-24 17:46:23 +01:00
parent 032fa26927
commit 41d1ab4c45
5 changed files with 27 additions and 12 deletions
+8
View File
@@ -0,0 +1,8 @@
package util
import "math/rand/v2"
func ShuffleSlice[T any](s []T) (ret []T) {
rand.Shuffle(len(s), func(i, j int) { s[i], s[j] = s[j], s[i] })
return s
}