mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Make SortedKeys an array for both
This commit is contained in:
@@ -152,8 +152,7 @@ namespace SabreTools.DatTools
|
||||
/// <param name="datFile">Current DatFile object to run operations on</param>
|
||||
internal void CleanDatItems(DatFile datFile)
|
||||
{
|
||||
List<string> keys = [.. datFile.Items.SortedKeys];
|
||||
foreach (string key in keys)
|
||||
foreach (string key in datFile.Items.SortedKeys)
|
||||
{
|
||||
// For every item in the current key
|
||||
var items = datFile.GetItemsForBucket(key);
|
||||
|
||||
@@ -109,8 +109,7 @@ namespace SabreTools.DatTools
|
||||
datFile.BucketBy(ItemKey.SHA1, DedupeType.None);
|
||||
|
||||
// Then we want to loop through each of the hashes and see if we can rebuild
|
||||
List<string> keys = [.. datFile.Items.SortedKeys];
|
||||
foreach (string hash in keys)
|
||||
foreach (string hash in datFile.Items.SortedKeys)
|
||||
{
|
||||
// Pre-empt any issues that could arise from string length
|
||||
if (hash.Length != Constants.SHA1Length)
|
||||
|
||||
@@ -83,17 +83,17 @@ namespace SabreTools.DatTools
|
||||
{
|
||||
DatStatistics individualStats = datdata.DatStatistics;
|
||||
individualStats.DisplayName = datdata.Header.GetStringFieldValue(DatHeader.FileNameKey);
|
||||
individualStats.MachineCount = datdata.Items.SortedKeys.Count;
|
||||
individualStats.MachineCount = datdata.Items.SortedKeys.Length;
|
||||
stats.Add(individualStats);
|
||||
}
|
||||
|
||||
// Add single DAT stats to dir
|
||||
dirStats.AddStatistics(datdata.DatStatistics);
|
||||
dirStats.GameCount += datdata.Items.SortedKeys.Count;
|
||||
dirStats.GameCount += datdata.Items.SortedKeys.Length;
|
||||
|
||||
// Add single DAT stats to totals
|
||||
totalStats.AddStatistics(datdata.DatStatistics);
|
||||
totalStats.GameCount += datdata.Items.SortedKeys.Count;
|
||||
totalStats.GameCount += datdata.Items.SortedKeys.Length;
|
||||
|
||||
// Make sure to assign the new directory
|
||||
lastdir = thisdir;
|
||||
|
||||
@@ -58,8 +58,7 @@ namespace SabreTools.DatTools
|
||||
datFile.BucketBy(ItemKey.SHA1, DedupeType.None);
|
||||
|
||||
// Then we want to loop through each of the hashes and see if we can rebuild
|
||||
List<string> keys = [.. datFile.Items.SortedKeys];
|
||||
foreach (string hash in keys)
|
||||
foreach (string hash in datFile.Items.SortedKeys)
|
||||
{
|
||||
// Pre-empt any issues that could arise from string length
|
||||
if (hash.Length != Constants.SHA1Length)
|
||||
@@ -216,8 +215,7 @@ namespace SabreTools.DatTools
|
||||
datFile.BucketBy(ItemKey.Machine, DedupeType.Full);
|
||||
|
||||
// Then mark items for removal
|
||||
List<string> keys = [.. datFile.Items.SortedKeys];
|
||||
foreach (string key in keys)
|
||||
foreach (string key in datFile.Items.SortedKeys)
|
||||
{
|
||||
List<DatItem>? items = datFile.GetItemsForBucket(key);
|
||||
if (items == null)
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace SabreTools.DatTools
|
||||
datFile.BucketBy(ItemKey.Machine, DedupeType.None, norename: true);
|
||||
|
||||
datFile.DatStatistics.DisplayName = datFile.Header.GetStringFieldValue(DatHeader.FileNameKey);
|
||||
datFile.DatStatistics.MachineCount = datFile.Items.SortedKeys.Count;
|
||||
datFile.DatStatistics.MachineCount = datFile.Items.SortedKeys.Length;
|
||||
|
||||
List<DatStatistics> statsList =
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user