diff --git a/HandheldCompanion/Managers/ControllerManager.cs b/HandheldCompanion/Managers/ControllerManager.cs index 64ec5b7e0..66a01acbb 100644 --- a/HandheldCompanion/Managers/ControllerManager.cs +++ b/HandheldCompanion/Managers/ControllerManager.cs @@ -565,7 +565,7 @@ private static void Watchdog_Elapsed(object? sender, ElapsedEventArgs e) lock (updateLock) { // monitoring unexpected slot changes - Dictionary UserIndexes = new(); + HashSet UserIndexes = new(); bool XInputDrunk = false; foreach (XInputController xInputController in Controllers.Values.Where(c => c.Details is not null && c.Details.isXInput)) { @@ -576,10 +576,9 @@ private static void Watchdog_Elapsed(object? sender, ElapsedEventArgs e) continue; // that's not possible, XInput is drunk - if (UserIndexes.ContainsKey(UserIndex)) + if (!UserIndexes.Add(UserIndex)) XInputDrunk = true; - UserIndexes.Add(UserIndex, true); xInputController.AttachController(UserIndex); }