Use enumerator for settings iteration

This commit is contained in:
Travis Nickles 2019-02-16 15:49:36 -06:00
parent a9e7a3cb5b
commit 40278c9d1b

View File

@ -1205,9 +1205,11 @@ namespace DS4Windows
DS4Controls usingExtra = DS4Controls.None; DS4Controls usingExtra = DS4Controls.None;
List<DS4ControlSettings> tempSettingsList = getDS4CSettings(device); List<DS4ControlSettings> tempSettingsList = getDS4CSettings(device);
//foreach (DS4ControlSettings dcs in getDS4CSettings(device)) //foreach (DS4ControlSettings dcs in getDS4CSettings(device))
for (int settingIndex = 0, arlen = tempSettingsList.Count; settingIndex < arlen; settingIndex++) //for (int settingIndex = 0, arlen = tempSettingsList.Count; settingIndex < arlen; settingIndex++)
for (var settingEnum = tempSettingsList.GetEnumerator(); settingEnum.MoveNext();)
{ {
DS4ControlSettings dcs = tempSettingsList[settingIndex]; //DS4ControlSettings dcs = tempSettingsList[settingIndex];
DS4ControlSettings dcs = settingEnum.Current;
object action = null; object action = null;
DS4ControlSettings.ActionType actionType = 0; DS4ControlSettings.ActionType actionType = 0;
DS4KeyType keyType = DS4KeyType.None; DS4KeyType keyType = DS4KeyType.None;