From a8b71d6dae223fd1f2151b56e764032c65fbad61 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 11 May 2025 21:19:28 -0400 Subject: [PATCH] Avoid unnecessary rereads in RemoveItemsFromRomOfChild --- SabreTools.DatFiles/DatFile.Splitting.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/SabreTools.DatFiles/DatFile.Splitting.cs b/SabreTools.DatFiles/DatFile.Splitting.cs index 4030a2ab..43febfc1 100644 --- a/SabreTools.DatFiles/DatFile.Splitting.cs +++ b/SabreTools.DatFiles/DatFile.Splitting.cs @@ -1223,14 +1223,13 @@ namespace SabreTools.DatFiles { while (true) { - // Reset the items list each time an item is removed so the index is accurate - items = GetItemsForBucket(bucket); - // Find the next index that matches the item int index = items.FindIndex(i => i.Equals(item)); if (index < 0) break; + // Remove the item from the local and internal lists + items.RemoveAt(index); RemoveItem(bucket, items[index], index); } }