From f1d376174bc41906489956bcbfc99d9581162669 Mon Sep 17 00:00:00 2001 From: whoswhip Date: Fri, 17 Oct 2025 02:12:50 -0400 Subject: [PATCH] refactor: use Random.Shared for permutation generation --- Spectrum/Input/MovementPaths.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Spectrum/Input/MovementPaths.cs b/Spectrum/Input/MovementPaths.cs index 5e5f0e8..53506f8 100644 --- a/Spectrum/Input/MovementPaths.cs +++ b/Spectrum/Input/MovementPaths.cs @@ -315,12 +315,9 @@ namespace Spectrum.Input { int[] perm = new int[256]; for (int i = 0; i < 256; i++) perm[i] = i; - string user = Environment.UserName; - int seed = Environment.TickCount + user.GetHashCode(); - Random rand = new(seed); for (int i = 255; i > 0; i--) { - int j = rand.Next(i + 1); + int j = Random.Shared.Next(i + 1); (perm[i], perm[j]) = (perm[j], perm[i]); } return perm;