From 9d5dfaaa68251997bd4386e3e61827b9c2f993cf Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 12 Jun 2024 14:49:16 -0400 Subject: [PATCH] Make match sets immutable --- CHANGELIST.md | 1 + MPF.Frontend/Tools/SubmissionGenerator.cs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index 56d6108d..7a109798 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -176,6 +176,7 @@ - Simplify DIC DMI location finding - Move track full matching to separate loop - Fix... something with Linux publish script +- Make match sets immutable ### 3.1.9a (2024-05-21) diff --git a/MPF.Frontend/Tools/SubmissionGenerator.cs b/MPF.Frontend/Tools/SubmissionGenerator.cs index 4197f26c..41650540 100644 --- a/MPF.Frontend/Tools/SubmissionGenerator.cs +++ b/MPF.Frontend/Tools/SubmissionGenerator.cs @@ -183,7 +183,7 @@ namespace MPF.Frontend.Tools // Setup the checks bool allFound = true; - List> foundIdSets = []; + List foundIdSets = []; // Loop through all of the hashdata to find matching IDs resultProgress?.Report(ResultEventArgs.Success("Finding disc matches on Redump...")); @@ -234,7 +234,7 @@ namespace MPF.Frontend.Tools resultProgress?.Report(ResultEventArgs.Failure(result)); // Add the found IDs to the map - foundIdSets.Add(foundIds ?? []); + foundIdSets.Add(foundIds?.ToArray() ?? []); // Ensure that all tracks are found allFound &= singleFound; @@ -250,7 +250,7 @@ namespace MPF.Frontend.Tools // First track is always all IDs if (fullyMatchedIDs == null) { - fullyMatchedIDs = set; + fullyMatchedIDs = [.. set]; continue; }