mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Reduce the number of steps
This commit is contained in:
@@ -151,21 +151,23 @@ namespace SabreTools.Helper
|
||||
{
|
||||
// Get all values in the dictionary and write out
|
||||
List<RomData> sortable = new List<RomData>();
|
||||
List<string> keys = dict.Keys.ToList();
|
||||
foreach (string key in keys)
|
||||
long count = 0;
|
||||
foreach (List<RomData> roms in dict.Values)
|
||||
{
|
||||
if (merge)
|
||||
{
|
||||
sortable.Add(dict[key][0]);
|
||||
dict.Remove(key);
|
||||
sortable.Add(roms[0]);
|
||||
count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
sortable.AddRange(dict[key]);
|
||||
dict.Remove(key);
|
||||
sortable.AddRange(roms);
|
||||
count += roms.Count;
|
||||
}
|
||||
}
|
||||
|
||||
logger.Log("The total number of items added for output is " + count);
|
||||
|
||||
// Sort the new list
|
||||
RomManipulation.Sort(sortable, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user