[Disk, Rom] Try #3 at correcting logic

This commit is contained in:
Matt Nadareski
2017-07-17 16:15:02 -07:00
parent 684dbe11f8
commit 8a721fd44d
2 changed files with 12 additions and 12 deletions

View File

@@ -128,11 +128,11 @@ namespace SabreTools.Library.Dats
} }
// If we can determine that the disks have no non-empty hashes in common, we return false // If we can determine that the disks have no non-empty hashes in common, we return false
if (!(String.IsNullOrEmpty(_md5) && String.IsNullOrEmpty(newOther.MD5)) if ((String.IsNullOrEmpty(_md5) || String.IsNullOrEmpty(newOther.MD5))
|| !(String.IsNullOrEmpty(_sha1) && String.IsNullOrEmpty(newOther.SHA1)) && (String.IsNullOrEmpty(_sha1) || String.IsNullOrEmpty(newOther.SHA1))
|| !(String.IsNullOrEmpty(_sha256) && String.IsNullOrEmpty(newOther.SHA256)) && (String.IsNullOrEmpty(_sha256) || String.IsNullOrEmpty(newOther.SHA256))
|| !(String.IsNullOrEmpty(_sha384) && String.IsNullOrEmpty(newOther.SHA384)) && (String.IsNullOrEmpty(_sha384) || String.IsNullOrEmpty(newOther.SHA384))
|| !(String.IsNullOrEmpty(_sha512) && String.IsNullOrEmpty(newOther.SHA512))) && (String.IsNullOrEmpty(_sha512) || String.IsNullOrEmpty(newOther.SHA512)))
{ {
dupefound = false; dupefound = false;
} }

View File

@@ -159,13 +159,13 @@ namespace SabreTools.Library.Dats
} }
// If we can determine that the roms have no non-empty hashes in common, we return false // If we can determine that the roms have no non-empty hashes in common, we return false
if (!(String.IsNullOrEmpty(_crc) && String.IsNullOrEmpty(newOther.CRC)) if ((String.IsNullOrEmpty(_crc) || String.IsNullOrEmpty(newOther.CRC))
|| !(String.IsNullOrEmpty(_md5) && String.IsNullOrEmpty(newOther.MD5)) && (String.IsNullOrEmpty(_md5) || String.IsNullOrEmpty(newOther.MD5))
|| !(String.IsNullOrEmpty(_sha1) && String.IsNullOrEmpty(newOther.SHA1)) && (String.IsNullOrEmpty(_sha1) || String.IsNullOrEmpty(newOther.SHA1))
|| !(String.IsNullOrEmpty(_sha256) && String.IsNullOrEmpty(newOther.SHA256)) && (String.IsNullOrEmpty(_sha256) || String.IsNullOrEmpty(newOther.SHA256))
|| !(String.IsNullOrEmpty(_sha384) && String.IsNullOrEmpty(newOther.SHA384)) && (String.IsNullOrEmpty(_sha384) || String.IsNullOrEmpty(newOther.SHA384))
|| !(String.IsNullOrEmpty(_sha512) && String.IsNullOrEmpty(newOther.SHA512))) && (String.IsNullOrEmpty(_sha512) || String.IsNullOrEmpty(newOther.SHA512)))
{ {
dupefound = false; dupefound = false;
} }
else if ((this.Size == newOther.Size) else if ((this.Size == newOther.Size)