From e7add2c0ae6932bd6b90a22c2b826e97f4a9f828 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 11 May 2025 21:26:37 -0400 Subject: [PATCH] Avoid unnecessary rereads in RemoveItemsFromCloneOfChild --- 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 43febfc1..416049ee 100644 --- a/SabreTools.DatFiles/DatFile.Splitting.cs +++ b/SabreTools.DatFiles/DatFile.Splitting.cs @@ -1112,14 +1112,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); } }