mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Create and use SortedKeys
This commit is contained in:
@@ -239,6 +239,20 @@ namespace SabreTools.Library.DatFiles
|
||||
DatHeader.Type = type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the keys in sorted order from the file dictionary
|
||||
/// </summary>
|
||||
/// <returns>List of the keys in sorted order</returns>
|
||||
public List<string> SortedKeys
|
||||
{
|
||||
get
|
||||
{
|
||||
var keys = Items.Keys.ToList();
|
||||
keys.Sort(new NaturalComparer());
|
||||
return keys;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ensure the key exists in the items dictionary
|
||||
/// </summary>
|
||||
@@ -1335,8 +1349,8 @@ namespace SabreTools.Library.DatFiles
|
||||
|
||||
// Now, loop through the dictionary and populate the correct DATs
|
||||
watch.Start("Populating all output DATs");
|
||||
List<string> keys = Keys;
|
||||
|
||||
List<string> keys = Keys;
|
||||
Parallel.ForEach(keys, Globals.ParallelOptions, key =>
|
||||
{
|
||||
List<DatItem> items = DatItem.Merge(this[key]);
|
||||
|
||||
Reference in New Issue
Block a user