Make SortedKeys an array for both

This commit is contained in:
Matt Nadareski
2025-01-14 15:59:47 -05:00
parent 616aea983b
commit 60d946fc6d
10 changed files with 38 additions and 82 deletions

View File

@@ -191,13 +191,12 @@ namespace SabreTools.DatFiles
/// <remarks>Applies to <see cref="Items"/></remarks>
private void ExecuteFiltersImpl(FilterRunner filterRunner)
{
List<string> keys = [.. Items.SortedKeys];
#if NET452_OR_GREATER || NETCOREAPP
Parallel.ForEach(keys, Core.Globals.ParallelOptions, key =>
Parallel.ForEach(Items.SortedKeys, Core.Globals.ParallelOptions, key =>
#elif NET40_OR_GREATER
Parallel.ForEach(keys, key =>
Parallel.ForEach(Items.SortedKeys, key =>
#else
foreach (var key in keys)
foreach (var key in Items.SortedKeys)
#endif
{
ExecuteFilterOnBucket(filterRunner, key);