mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fix RemoveItemFieldsDB logic
This commit is contained in:
@@ -73,6 +73,23 @@ namespace SabreTools.DatFiles
|
|||||||
if (ItemsDB == null || (machineFieldNames.Count == 0 && itemFieldNames.Count == 0))
|
if (ItemsDB == null || (machineFieldNames.Count == 0 && itemFieldNames.Count == 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Handle machine removals
|
||||||
|
#if NET452_OR_GREATER || NETCOREAPP
|
||||||
|
Parallel.ForEach(ItemsDB.GetMachines(), Core.Globals.ParallelOptions, kvp =>
|
||||||
|
#elif NET40_OR_GREATER
|
||||||
|
Parallel.ForEach(ItemsDB.GetMachines(), kvp =>
|
||||||
|
#else
|
||||||
|
foreach (var kvp in ItemsDB.GetMachines())
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
RemoveFields(kvp.Value, machineFieldNames);
|
||||||
|
#if NET40_OR_GREATER || NETCOREAPP
|
||||||
|
});
|
||||||
|
#else
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Handle item removals
|
||||||
#if NET452_OR_GREATER || NETCOREAPP
|
#if NET452_OR_GREATER || NETCOREAPP
|
||||||
Parallel.ForEach(ItemsDB.SortedKeys, Core.Globals.ParallelOptions, key =>
|
Parallel.ForEach(ItemsDB.SortedKeys, Core.Globals.ParallelOptions, key =>
|
||||||
#elif NET40_OR_GREATER
|
#elif NET40_OR_GREATER
|
||||||
@@ -91,7 +108,7 @@ namespace SabreTools.DatFiles
|
|||||||
|
|
||||||
foreach (var item in items.Values)
|
foreach (var item in items.Values)
|
||||||
{
|
{
|
||||||
RemoveFields(item, machineFieldNames, itemFieldNames);
|
RemoveFields(item, [], itemFieldNames);
|
||||||
}
|
}
|
||||||
#if NET40_OR_GREATER || NETCOREAPP
|
#if NET40_OR_GREATER || NETCOREAPP
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user