Use Keys instead of selecting each pair's key with LINQ

This commit is contained in:
YoshiRulz 2019-03-24 19:54:57 +10:00
parent e790d904cb
commit 6045992464
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
7 changed files with 8 additions and 20 deletions

View File

@ -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);
}
}
} }
} }

View File

@ -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);

View File

@ -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)
{ {

View File

@ -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)
{ {

View File

@ -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)
{ {

View File

@ -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)
{ {

View File

@ -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);
}
}
} }
} }