From 6716c3fd8fcc817302ef1bc71488560e814c1872 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Mon, 8 Feb 2021 12:21:53 +1000 Subject: [PATCH] Inline FirmwareDatabase.LookupFirmwareRecord --- src/BizHawk.Client.Common/FirmwareManager.cs | 5 ++++- src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs | 7 ------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/BizHawk.Client.Common/FirmwareManager.cs b/src/BizHawk.Client.Common/FirmwareManager.cs index 8991f59021..14860e7ba9 100644 --- a/src/BizHawk.Client.Common/FirmwareManager.cs +++ b/src/BizHawk.Client.Common/FirmwareManager.cs @@ -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 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; diff --git a/src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs b/src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs index 404a26dc16..02482c311a 100644 --- a/src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs +++ b/src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs @@ -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 }