mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fun with HashSets
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using SabreTools.Hashing;
|
using SabreTools.Hashing;
|
||||||
using SabreTools.Models.Metadata;
|
using SabreTools.Models.Metadata;
|
||||||
@@ -148,9 +149,9 @@ namespace SabreTools.Core
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// If any keys are missing on either side, they can't match
|
// If any keys are missing on either side, they can't match
|
||||||
if (self.Keys.Except(other.Keys).Any())
|
var selfKeys = new HashSet<string>(self.Keys);
|
||||||
return false;
|
var otherKeys = new HashSet<string>(other.Keys);
|
||||||
if (other.Keys.Except(self.Keys).Any())
|
if (!selfKeys.SetEquals(otherKeys))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Check all pairs to see if they're equal
|
// Check all pairs to see if they're equal
|
||||||
@@ -687,7 +688,8 @@ namespace SabreTools.Core
|
|||||||
case (Rom romSelf, Rom romOther):
|
case (Rom romSelf, Rom romOther):
|
||||||
romSelf.FillMissingHashes(romOther);
|
romSelf.FillMissingHashes(romOther);
|
||||||
break;
|
break;
|
||||||
};
|
}
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user