From 505e7481f7c150e2b7d5ee9b1ec33031dee2e2f5 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Thu, 4 Jan 2024 18:10:20 +0100 Subject: [PATCH] Small Novation-detection refactoring --- RGB.NET.Devices.Novation/NovationDeviceProvider.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/RGB.NET.Devices.Novation/NovationDeviceProvider.cs b/RGB.NET.Devices.Novation/NovationDeviceProvider.cs index 9a86f6f..e3c9b77 100644 --- a/RGB.NET.Devices.Novation/NovationDeviceProvider.cs +++ b/RGB.NET.Devices.Novation/NovationDeviceProvider.cs @@ -65,11 +65,10 @@ public sealed class NovationDeviceProvider : AbstractRGBDeviceProvider MidiOutCaps outCaps = OutputDeviceBase.GetDeviceCapabilities(index); if (outCaps.name == null) continue; - string deviceName = outCaps.name.ToUpperInvariant(); NovationDevices? deviceId = (NovationDevices?)Enum.GetValues(typeof(NovationDevices)) .Cast() .Where(x => x.GetDeviceId() != null) - .FirstOrDefault(x => deviceName.Contains(x.GetDeviceId()!.ToUpperInvariant())); + .FirstOrDefault(x => outCaps.name.Contains(x.GetDeviceId()!, StringComparison.InvariantCultureIgnoreCase)); if (deviceId == null) continue;