Skip to content

Commit

Permalink
Implement GetHashCode
Browse files Browse the repository at this point in the history
Implements GetHashCode to resolve build warnings.  Related to issue https://github.com/MonoGame/monogame.github.io/issues/92
  • Loading branch information
AristurtleDev committed Feb 5, 2024
1 parent ab267dc commit 73fcef7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions MonoGame.Framework/Platform/SDL/SDL2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ public override bool Equals(object obj)
return version == (Version)obj;
}

public override int GetHashCode()
{
unchecked
{
int hash = 17;
hash = hash * 23 + Major.GetHashCode();
hash = hash * 23 + Minor.GetHashCode();
hash = hash * 23 + Patch.GetHashCode();
return hash;
}
}

public static bool operator !=(Version version1, Version version2)
{
return !(version1 == version2);
Expand Down

0 comments on commit 73fcef7

Please sign in to comment.