mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Second experimental attempt at improving merges
This commit is contained in:
@@ -568,6 +568,7 @@ namespace SabreTools.Helper
|
|||||||
{
|
{
|
||||||
List<RomData> outroms = new List<RomData>();
|
List<RomData> outroms = new List<RomData>();
|
||||||
|
|
||||||
|
/*
|
||||||
// First sort the roms by size, crc, sysid, srcid, md5, and sha1 (in order), if not sorted already
|
// First sort the roms by size, crc, sysid, srcid, md5, and sha1 (in order), if not sorted already
|
||||||
if (!presorted)
|
if (!presorted)
|
||||||
{
|
{
|
||||||
@@ -633,6 +634,36 @@ namespace SabreTools.Helper
|
|||||||
return (int)(x.Size - y.Size);
|
return (int)(x.Size - y.Size);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// First sort the roms by size, crc, md5, sha1, sysid, srcid (in order), if not sorted already
|
||||||
|
if (!presorted)
|
||||||
|
{
|
||||||
|
inroms.Sort(delegate (RomData x, RomData y)
|
||||||
|
{
|
||||||
|
if (x.Size == y.Size)
|
||||||
|
{
|
||||||
|
if (x.CRC == y.CRC)
|
||||||
|
{
|
||||||
|
if (x.MD5 == y.MD5)
|
||||||
|
{
|
||||||
|
if (x.SHA1 == y.SHA1)
|
||||||
|
{
|
||||||
|
if (x.SystemID == y.SystemID)
|
||||||
|
{
|
||||||
|
return x.SourceID - y.SourceID;
|
||||||
|
}
|
||||||
|
return x.SystemID - y.SystemID;
|
||||||
|
}
|
||||||
|
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
|
// Then, deduplicate them by checking to see if data matches
|
||||||
foreach (RomData rom in inroms)
|
foreach (RomData rom in inroms)
|
||||||
|
|||||||
Reference in New Issue
Block a user