Make SortedKeys an array for both

This commit is contained in:
Matt Nadareski
2025-01-14 15:59:47 -05:00
parent 616aea983b
commit 60d946fc6d
10 changed files with 38 additions and 82 deletions

View File

@@ -58,8 +58,7 @@ namespace SabreTools.DatTools
datFile.BucketBy(ItemKey.SHA1, DedupeType.None);
// Then we want to loop through each of the hashes and see if we can rebuild
List<string> keys = [.. datFile.Items.SortedKeys];
foreach (string hash in keys)
foreach (string hash in datFile.Items.SortedKeys)
{
// Pre-empt any issues that could arise from string length
if (hash.Length != Constants.SHA1Length)
@@ -216,8 +215,7 @@ namespace SabreTools.DatTools
datFile.BucketBy(ItemKey.Machine, DedupeType.Full);
// Then mark items for removal
List<string> keys = [.. datFile.Items.SortedKeys];
foreach (string key in keys)
foreach (string key in datFile.Items.SortedKeys)
{
List<DatItem>? items = datFile.GetItemsForBucket(key);
if (items == null)