Slight rearrangement, Some issues popped up with ordering

This commit is contained in:
Matt Nadareski
2016-05-13 12:16:03 -07:00
parent f463f3b767
commit ec228fc499

View File

@@ -568,31 +568,31 @@ namespace SabreTools.Helper
{ {
List<RomData> outroms = new List<RomData>(); List<RomData> outroms = new List<RomData>();
// First sort the roms by sha1, md5, crc, size, sysid, srcid (in order) if not sorted already // First sort the roms by sha1, sysid, srcid, md5, crc, size (in order) if not sorted already
if (!presorted) if (!presorted)
{ {
inroms.Sort(delegate (RomData x, RomData y) inroms.Sort(delegate (RomData x, RomData y)
{ {
if (x.SHA1 == y.SHA1) if (x.SHA1 == y.SHA1)
{
if (x.SystemID == y.SystemID)
{
if (x.SourceID == y.SourceID)
{ {
if (x.MD5 == y.MD5) if (x.MD5 == y.MD5)
{ {
if (x.CRC == y.CRC) if (x.CRC == y.CRC)
{ {
if (x.Size == y.Size)
{
if (x.SystemID == y.SystemID)
{
return x.SourceID - y.SourceID;
}
return x.SystemID - y.SystemID;
}
return (int)(x.Size - y.Size); return (int)(x.Size - y.Size);
} }
return String.Compare(x.CRC, y.CRC); return String.Compare(x.CRC, y.CRC);
} }
return String.Compare(x.MD5, y.MD5); return String.Compare(x.MD5, y.MD5);
} }
return x.SourceID - y.SourceID;
}
return x.SystemID - y.SystemID;
}
return String.Compare(x.SHA1, y.SHA1); return String.Compare(x.SHA1, y.SHA1);
}); });
} }