diff --git a/ArcdpsLogManager/Sections/GameDataGathering.cs b/ArcdpsLogManager/Sections/GameDataGathering.cs index a1fd22b9..8540cdc1 100644 --- a/ArcdpsLogManager/Sections/GameDataGathering.cs +++ b/ArcdpsLogManager/Sections/GameDataGathering.cs @@ -45,10 +45,7 @@ public override bool Equals(object obj) public override int GetHashCode() { - unchecked - { - return (SpeciesId * 397) ^ (Name != null ? Name.GetHashCode() : 0); - } + return HashCode.Combine(SpeciesId, Name); } public static bool operator ==(SpeciesData left, SpeciesData right) @@ -91,10 +88,7 @@ public override bool Equals(object obj) public override int GetHashCode() { - unchecked - { - return ((int) SkillId * 397) ^ (Name != null ? Name.GetHashCode() : 0); - } + return HashCode.Combine(SkillId, Name); } public static bool operator ==(SkillData left, SkillData right) diff --git a/Tests/EVTCAnalytics.LogTests/LogPlayer.cs b/Tests/EVTCAnalytics.LogTests/LogPlayer.cs index 025977ef..f4e508a0 100644 --- a/Tests/EVTCAnalytics.LogTests/LogPlayer.cs +++ b/Tests/EVTCAnalytics.LogTests/LogPlayer.cs @@ -29,15 +29,7 @@ public override bool Equals(object obj) public override int GetHashCode() { - unchecked - { - int hashCode = (CharacterName != null ? CharacterName.GetHashCode() : 0); - hashCode = (hashCode * 397) ^ (AccountName != null ? AccountName.GetHashCode() : 0); - hashCode = (hashCode * 397) ^ (int) Profession; - hashCode = (hashCode * 397) ^ (int) EliteSpecialization; - hashCode = (hashCode * 397) ^ Subgroup; - return hashCode; - } + return HashCode.Combine(CharacterName, AccountName, (int) Profession, (int) EliteSpecialization, Subgroup); } public static bool operator ==(LogPlayer left, LogPlayer right)