mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFile] Attempt to make most DAT functions quicker
This commit is contained in:
@@ -3247,6 +3247,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
|
|
||||||
// If the output type isn't set already, get the internal output type
|
// If the output type isn't set already, get the internal output type
|
||||||
DatFormat = (DatFormat == 0 ? Utilities.GetDatFormatFromFile(filename) : DatFormat);
|
DatFormat = (DatFormat == 0 ? Utilities.GetDatFormatFromFile(filename) : DatFormat);
|
||||||
|
_sortedBy = SortedBy.CRC; // Setting this because it can reduce issues later
|
||||||
|
|
||||||
// Now parse the correct type of DAT
|
// Now parse the correct type of DAT
|
||||||
try
|
try
|
||||||
@@ -3405,28 +3406,8 @@ namespace SabreTools.Library.DatFiles
|
|||||||
item = itemDisk;
|
item = itemDisk;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the key and add statistical data
|
// Get the key and add the file
|
||||||
switch (item.Type)
|
key = GetKey(item, SortedBy.CRC);
|
||||||
{
|
|
||||||
case ItemType.Archive:
|
|
||||||
case ItemType.BiosSet:
|
|
||||||
case ItemType.Blank:
|
|
||||||
case ItemType.Release:
|
|
||||||
case ItemType.Sample:
|
|
||||||
key = item.Type.ToString();
|
|
||||||
break;
|
|
||||||
case ItemType.Disk:
|
|
||||||
key = ((Disk)item).MD5 ?? (((Disk)item).SHA1 ?? "nodump");
|
|
||||||
break;
|
|
||||||
case ItemType.Rom:
|
|
||||||
key = ((Rom)item).Size + "-" + ((Rom)item).CRC;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
key = "default";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the item to the DAT
|
|
||||||
Add(key, item);
|
Add(key, item);
|
||||||
|
|
||||||
return key;
|
return key;
|
||||||
|
|||||||
Reference in New Issue
Block a user