diff --git a/SabreTools.DatFiles/DatFile.Filtering.cs b/SabreTools.DatFiles/DatFile.Filtering.cs index 33f33e44..04f799c9 100644 --- a/SabreTools.DatFiles/DatFile.Filtering.cs +++ b/SabreTools.DatFiles/DatFile.Filtering.cs @@ -242,16 +242,11 @@ namespace SabreTools.DatFiles return; // Filter all items in the current key - List newItems = []; foreach (var item in items) { if (item.PassesFilter(filterRunner)) - newItems.Add(item); + item.SetFieldValue(DatItem.RemoveKey, true); } - - // Set the value in the key to the new set - Remove(bucketName); - Add(bucketName, newItems); } /// @@ -270,11 +265,8 @@ namespace SabreTools.DatFiles foreach (var item in items) { if (item.Value.PassesFilterDB(filterRunner)) - newItems.Add(item.Key); + item.Value.SetFieldValue(DatItem.RemoveKey, true); } - - // Set the value in the key to the new set - ItemsDB._buckets[bucketName] = newItems; } ///