mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[RomTools] Don't need to sort roms
Because we no longer rely explicitly on rom order to make sure there are no duplicates, there's no need to spend the extra step of sorting the list first.
This commit is contained in:
@@ -155,25 +155,7 @@ namespace SabreTools.Helper
|
|||||||
// Create output list
|
// Create output list
|
||||||
List<RomData> outroms = new List<RomData>();
|
List<RomData> outroms = new List<RomData>();
|
||||||
|
|
||||||
// First sort the roms by size, crc, md5, sha1 (in order)
|
// Then deduplicate them by checking to see if data matches previous saved roms
|
||||||
inroms.Sort(delegate (RomData x, RomData y)
|
|
||||||
{
|
|
||||||
if (x.Size == y.Size)
|
|
||||||
{
|
|
||||||
if (x.CRC == y.CRC)
|
|
||||||
{
|
|
||||||
if (x.MD5 == y.MD5)
|
|
||||||
{
|
|
||||||
return String.Compare(x.SHA1, y.SHA1);
|
|
||||||
}
|
|
||||||
return String.Compare(x.MD5, y.MD5);
|
|
||||||
}
|
|
||||||
return String.Compare(x.CRC, y.CRC);
|
|
||||||
}
|
|
||||||
return (int)(x.Size - y.Size);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Then, deduplicate them by checking to see if data matches
|
|
||||||
foreach (RomData rom in inroms)
|
foreach (RomData rom in inroms)
|
||||||
{
|
{
|
||||||
// If it's a nodump, add and skip
|
// If it's a nodump, add and skip
|
||||||
|
|||||||
Reference in New Issue
Block a user