mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Reduce array allocations
This commit is contained in:
@@ -44,6 +44,7 @@ contents of any changed dats.";
|
||||
// Get feature flags
|
||||
int workers = GetInt32(features, WorkersInt32Value);
|
||||
string? missingSha1s = GetString(features, MissingSha1sStringValue);
|
||||
HashType[] hashes = [HashType.CRC32, HashType.MD5, HashType.SHA1];
|
||||
|
||||
// Make sure the db is set
|
||||
if (string.IsNullOrWhiteSpace(_db))
|
||||
@@ -69,7 +70,7 @@ contents of any changed dats.";
|
||||
// First get a list of SHA-1's from the input DATs
|
||||
DatFile datroot = DatFile.Create();
|
||||
datroot.Header.SetFieldValue<string?>(SabreTools.Models.Metadata.Header.TypeKey, "SuperDAT");
|
||||
DatFromDir.PopulateFromDir(datroot, _dats, asFiles: TreatAsFile.NonArchive, hashes: [HashType.CRC32, HashType.MD5, HashType.SHA1]);
|
||||
DatFromDir.PopulateFromDir(datroot, _dats, asFiles: TreatAsFile.NonArchive, hashes: hashes);
|
||||
datroot.Items.BucketBy(ItemKey.SHA1, DedupeType.None);
|
||||
|
||||
// Create a List of dat hashes in the database (SHA-1)
|
||||
|
||||
Reference in New Issue
Block a user