Reduce Linq usage a little bit more

This commit is contained in:
Matt Nadareski
2025-04-14 13:52:43 -04:00
parent 0f2990d706
commit 7726ef4552
4 changed files with 26 additions and 14 deletions

View File

@@ -1069,16 +1069,15 @@ namespace SabreTools.DatFiles
var datItems = itemIndices
.FindAll(i => _items.ContainsKey(i))
.Select(i => new KeyValuePair<long, DatItem>(i, _items[i]))
.ToList();
.ConvertAll(i => new KeyValuePair<long, DatItem>(i, _items[i]));
Sort(ref datItems, norename);
#if NET40_OR_GREATER || NETCOREAPP
_buckets.TryAdd(bucketKeys[i], [.. datItems.Select(kvp => kvp.Key)]);
_buckets.TryAdd(bucketKeys[i], datItems.ConvertAll(kvp => kvp.Key));
});
#else
_buckets[bucketKeys[i]] = [.. datItems.Select(kvp => kvp.Key)];
_buckets[bucketKeys[i]] = datItems.ConvertAll(kvp => kvp.Key);
}
#endif
}