mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-22 17:29:18 +01:00
Get rid of more ElementAt usage
Old code is commented out as a reference
This commit is contained in:
parent
61a5ab07ea
commit
3417c08a87
@ -248,9 +248,11 @@ namespace DS4Windows
|
||||
if (disabledDevCount > 0)
|
||||
{
|
||||
List<HidDevice> disabledDevList = new List<HidDevice>();
|
||||
for (int i = 0, arlen = disabledDevCount; i < arlen; i++)
|
||||
for (var devEnum = DisabledDevices.GetEnumerator(); devEnum.MoveNext();)
|
||||
//for (int i = 0, arlen = disabledDevCount; i < arlen; i++)
|
||||
{
|
||||
HidDevice tempDev = DisabledDevices.ElementAt(i);
|
||||
//HidDevice tempDev = DisabledDevices.ElementAt(i);
|
||||
HidDevice tempDev = devEnum.Current;
|
||||
if (tempDev != null)
|
||||
{
|
||||
if (tempDev.IsOpen && tempDev.IsConnected)
|
||||
|
@ -46,9 +46,11 @@ namespace DS4Windows
|
||||
List<HidDevice> foundDevs = new List<HidDevice>();
|
||||
int devInfoLen = devInfo.Length;
|
||||
IEnumerable<DeviceInfo> temp = EnumerateDevices();
|
||||
for (int i = 0, len = temp.Count(); i < len; i++)
|
||||
for (var devEnum = temp.GetEnumerator(); devEnum.MoveNext();)
|
||||
//for (int i = 0, len = temp.Count(); i < len; i++)
|
||||
{
|
||||
DeviceInfo x = temp.ElementAt(i);
|
||||
DeviceInfo x = devEnum.Current;
|
||||
//DeviceInfo x = temp.ElementAt(i);
|
||||
HidDevice tempDev = new HidDevice(x.Path, x.Description);
|
||||
bool found = false;
|
||||
for (int j = 0; !found && j < devInfoLen; j++)
|
||||
|
Loading…
Reference in New Issue
Block a user