Start adding IDDB in parallel with existing dictionary

This commit is contained in:
Matt Nadareski
2024-03-19 15:21:01 -04:00
parent eda21cdf73
commit b494394249
6 changed files with 191 additions and 100 deletions

View File

@@ -105,6 +105,21 @@ namespace SabreTools.DatFiles
#region Fields
/// <summary>
/// Get the keys in sorted order from the file dictionary
/// </summary>
/// <returns>List of the keys in sorted order</returns>
[JsonIgnore, XmlIgnore]
public string[] SortedKeys
{
get
{
List<string> keys = [.. _buckets.Keys];
keys.Sort(new NaturalComparer());
return keys.ToArray();
}
}
/// <summary>
/// DAT statistics
/// </summary>
@@ -232,16 +247,6 @@ namespace SabreTools.DatFiles
}
}
/// <summary>
/// Get all bucket keys
/// </summary>
public string[] GetBucketKeys()
{
List<string> keys = [.. _buckets.Keys];
keys.Sort(new NaturalComparer());
return keys.ToArray();
}
/// <summary>
/// Get an item based on the index
/// </summary>
@@ -849,7 +854,7 @@ namespace SabreTools.DatFiles
/// <param name="filterRunner">Preconfigured filter runner to use</param>
public void ExecuteFilters(FilterRunner filterRunner)
{
List<string> keys = [.. GetBucketKeys()];
List<string> keys = [.. SortedKeys];
#if NET452_OR_GREATER || NETCOREAPP
Parallel.ForEach(keys, Globals.ParallelOptions, key =>
#elif NET40_OR_GREATER