mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-02-09 05:03:25 +01:00
Found issue with IEnumerable in this case. Use temp list instead.
This commit is contained in:
parent
83c7bb7740
commit
6716291a95
@ -36,14 +36,15 @@ namespace DS4Windows
|
|||||||
// Sort Bluetooth first in case USB is also connected on the same controller.
|
// Sort Bluetooth first in case USB is also connected on the same controller.
|
||||||
hDevices = hDevices.OrderBy<HidDevice, ConnectionType>((HidDevice d) => { return DS4Device.HidConnectionType(d); });
|
hDevices = hDevices.OrderBy<HidDevice, ConnectionType>((HidDevice d) => { return DS4Device.HidConnectionType(d); });
|
||||||
|
|
||||||
int devCount = hDevices.Count();
|
List<HidDevice> tempList = hDevices.ToList();
|
||||||
|
int devCount = tempList.Count();
|
||||||
string devicePlural = "device" + (devCount == 0 || devCount > 1 ? "s" : "");
|
string devicePlural = "device" + (devCount == 0 || devCount > 1 ? "s" : "");
|
||||||
//Log.LogToGui("Found " + devCount + " possible " + devicePlural + ". Examining " + devicePlural + ".", false);
|
//Log.LogToGui("Found " + devCount + " possible " + devicePlural + ". Examining " + devicePlural + ".", false);
|
||||||
|
|
||||||
for (int i = 0; i < devCount; i++)
|
for (int i = 0; i < devCount; i++)
|
||||||
//foreach (HidDevice hDevice in hDevices)
|
//foreach (HidDevice hDevice in hDevices)
|
||||||
{
|
{
|
||||||
HidDevice hDevice = hDevices.ElementAt<HidDevice>(i);
|
HidDevice hDevice = tempList[i];
|
||||||
if (DevicePaths.Contains(hDevice.DevicePath))
|
if (DevicePaths.Contains(hDevice.DevicePath))
|
||||||
continue; // BT/USB endpoint already open once
|
continue; // BT/USB endpoint already open once
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user