[Structs, RomTools] Move Rom comparison to struct

This commit is contained in:
Matt Nadareski
2016-08-29 14:08:10 -07:00
parent e38950ee7a
commit 5bea65e9a3
2 changed files with 30 additions and 23 deletions

View File

@@ -241,22 +241,7 @@ namespace SabreTools.Helper
/// <returns>True if the roms are duplicates, false otherwise</returns>
public static bool IsDuplicate(Rom rom, Rom lastrom, Logger logger)
{
bool dupefound = false;
// If either is a nodump, it's never a match
if (rom.Nodump || lastrom.Nodump)
{
return dupefound;
}
if (rom.Type == ItemType.Rom && lastrom.Type == ItemType.Rom)
{
dupefound = rom.HashData.Equals(lastrom.HashData, false);
}
else if (rom.Type == ItemType.Disk && lastrom.Type == ItemType.Disk)
{
dupefound = rom.HashData.Equals(lastrom.HashData, true);
}
bool dupefound = rom.Equals(lastrom);
// More wonderful SHA-1 logging that has to be done
if (rom.HashData.SHA1 == lastrom.HashData.SHA1 && rom.HashData.Size != lastrom.HashData.Size)