Inline FirmwareDatabase.LookupFirmwareRecord

This commit is contained in:
YoshiRulz 2021-02-08 12:21:53 +10:00
parent 33a788d74b
commit 6716c3fd8f
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 4 additions and 8 deletions

View File

@ -59,7 +59,10 @@ namespace BizHawk.Client.Common
// Requests the specified firmware. tries really hard to scan and resolve as necessary
public string Request(PathEntryCollection pathEntries, IDictionary<string, string> userSpecifications, string sysId, string firmwareId)
{
var resolved = Resolve(pathEntries, userSpecifications, FirmwareDatabase.LookupFirmwareRecord(sysId, firmwareId));
var resolved = Resolve(
pathEntries,
userSpecifications,
FirmwareDatabase.FirmwareRecords.FirstOrDefault(fr => fr.FirmwareId == firmwareId && fr.SystemId == sysId));
if (resolved == null)
{
return null;

View File

@ -1,4 +1,3 @@
using System.Linq;
using System.Collections.Generic;
// ReSharper disable IdentifierTypo
@ -401,11 +400,5 @@ namespace BizHawk.Emulation.Common
public bool IsAcceptableOrIdeal => Status == FirmwareOptionStatus.Ideal || Status == FirmwareOptionStatus.Acceptable;
public string ConfigKey => $"{SystemId}+{FirmwareId}";
}
public static FirmwareRecord LookupFirmwareRecord(string sysId, string firmwareId)
{
return FirmwareRecords
.FirstOrDefault(fr => fr.FirmwareId == firmwareId && fr.SystemId == sysId);
}
} // static class FirmwareDatabase
}