Be smarter about ClearEmpty DB

This commit is contained in:
Matt Nadareski
2025-01-14 21:06:12 -05:00
parent d52f139e73
commit e5bde14f19

View File

@@ -314,10 +314,10 @@ namespace SabreTools.DatFiles
continue; continue;
// Convert to list of indices for ease of access // Convert to list of indices for ease of access
List<long> itemsList = [.. items.Keys]; List<DatItem> itemsList = [.. items.Values];
// If there are no non-blank items, remove // If there are no non-blank items, remove
if (!itemsList.Exists(i => GetItem(i) != null && GetItem(i) is not Blank)) if (!itemsList.Exists(i => i != null && i is not Blank))
#if NET40_OR_GREATER || NETCOREAPP #if NET40_OR_GREATER || NETCOREAPP
_buckets.TryRemove(key, out _); _buckets.TryRemove(key, out _);
#else #else