Use Keys instead of selecting each pair's key with LINQ
This commit is contained in:
parent
e790d904cb
commit
6045992464
|
@ -72,12 +72,6 @@ namespace BizHawk.Client.ApiHawk
|
||||||
return _Apis.ContainsKey(t);
|
return _Apis.ContainsKey(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<Type> AvailableApis
|
public IEnumerable<Type> AvailableApis => _Apis.Keys;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _Apis.Select(d => d.Key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -238,12 +238,12 @@ namespace BizHawk.Client.Common
|
||||||
frame = 1;
|
frame = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<KeyValuePair<int, StateManagerState>> statesToRemove = _states.Where(s => s.Key >= frame).ToList();
|
var statesToRemove = _states.Keys.Where(k => k >= frame).ToList();
|
||||||
anyInvalidated = statesToRemove.Any();
|
anyInvalidated = statesToRemove.Any();
|
||||||
|
|
||||||
foreach (var state in statesToRemove)
|
foreach (var state in statesToRemove)
|
||||||
{
|
{
|
||||||
RemoveState(state.Key);
|
RemoveState(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
CallInvalidateCallback(frame);
|
CallInvalidateCallback(frame);
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
_syncSettings = ((A7800Hawk)Global.Emulator).GetSyncSettings().Clone();
|
_syncSettings = ((A7800Hawk)Global.Emulator).GetSyncSettings().Clone();
|
||||||
|
|
||||||
var possibleControllers = A7800HawkControllerDeck.ValidControllerTypes.Select(t => t.Key);
|
var possibleControllers = A7800HawkControllerDeck.ValidControllerTypes.Keys;
|
||||||
|
|
||||||
foreach (var val in possibleControllers)
|
foreach (var val in possibleControllers)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
_syncSettings = ((A7800Hawk)Global.Emulator).GetSyncSettings().Clone();
|
_syncSettings = ((A7800Hawk)Global.Emulator).GetSyncSettings().Clone();
|
||||||
|
|
||||||
var possibleFilters = A7800Hawk.ValidFilterTypes.Select(t => t.Key);
|
var possibleFilters = A7800Hawk.ValidFilterTypes.Keys;
|
||||||
|
|
||||||
foreach (var val in possibleFilters)
|
foreach (var val in possibleFilters)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
_syncSettings = ((ColecoVision)Global.Emulator).GetSyncSettings().Clone();
|
_syncSettings = ((ColecoVision)Global.Emulator).GetSyncSettings().Clone();
|
||||||
|
|
||||||
var possibleControllers = ColecoVisionControllerDeck.ValidControllerTypes.Select(t => t.Key);
|
var possibleControllers = ColecoVisionControllerDeck.ValidControllerTypes.Keys;
|
||||||
|
|
||||||
foreach (var val in possibleControllers)
|
foreach (var val in possibleControllers)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
_syncSettings = ((Intellivision)Global.Emulator).GetSyncSettings().Clone();
|
_syncSettings = ((Intellivision)Global.Emulator).GetSyncSettings().Clone();
|
||||||
|
|
||||||
var possibleControllers = IntellivisionControllerDeck.ValidControllerTypes.Select(t => t.Key);
|
var possibleControllers = IntellivisionControllerDeck.ValidControllerTypes.Keys;
|
||||||
|
|
||||||
foreach (var val in possibleControllers)
|
foreach (var val in possibleControllers)
|
||||||
{
|
{
|
||||||
|
|
|
@ -86,12 +86,6 @@ namespace BizHawk.Emulation.Common
|
||||||
return _services.ContainsKey(t);
|
return _services.ContainsKey(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<Type> AvailableServices
|
public IEnumerable<Type> AvailableServices => _services.Keys;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _services.Select(d => d.Key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue