[DatItem] Remove unnecessary logging

This commit is contained in:
Matt Nadareski
2017-03-18 21:57:58 -07:00
parent 5ecc110ce0
commit 79b6d36473

View File

@@ -166,28 +166,12 @@ namespace SabreTools.Helper.Dats
return ret; return ret;
} }
public abstract bool Equals(DatItem other);
/// <summary> /// <summary>
/// Determine if an item is a duplicate using partial matching logic /// Determine if an item is a duplicate using partial matching logic
/// </summary> /// </summary>
/// <param name="lastItem">DatItem to use as a baseline</param> /// <param name="other">DatItem to use as a baseline</param>
/// <returns>True if the roms are duplicates, false otherwise</returns> /// <returns>True if the roms are duplicates, false otherwise</returns>
public bool IsDuplicate(DatItem lastItem) public abstract bool Equals(DatItem other);
{
bool dupefound = this.Equals(lastItem);
// More wonderful SHA-1 logging that has to be done
if (_itemType == ItemType.Rom && lastItem.Type == ItemType.Rom)
{
if (!String.IsNullOrEmpty(((Rom)this).SHA1) && ((Rom)this).SHA1 == ((Rom)lastItem).SHA1 && ((Rom)this).Size != ((Rom)lastItem).Size)
{
Globals.Logger.User("SHA-1 mismatch - Hash: " + ((Rom)this).SHA1);
}
}
return dupefound;
}
/// <summary> /// <summary>
/// Return the duplicate status of two items /// Return the duplicate status of two items
@@ -199,7 +183,7 @@ namespace SabreTools.Helper.Dats
DupeType output = 0x00; DupeType output = 0x00;
// If we don't have a duplicate at all, return none // If we don't have a duplicate at all, return none
if (!this.IsDuplicate(lastItem)) if (!this.Equals(lastItem))
{ {
return output; return output;
} }
@@ -264,7 +248,7 @@ namespace SabreTools.Helper.Dats
foreach (DatItem rom in roms) foreach (DatItem rom in roms)
{ {
if (IsDuplicate(rom)) if (this.Equals(rom))
{ {
return true; return true;
} }
@@ -304,7 +288,7 @@ namespace SabreTools.Helper.Dats
foreach (DatItem rom in roms) foreach (DatItem rom in roms)
{ {
if (IsDuplicate(rom)) if (this.Equals(rom))
{ {
output.Add(rom); output.Add(rom);
} }