Skip to content

Commit da3568c

Browse files
AristurtleDevviniciusjarina
authored andcommitted
Implement GetHashCode (MonoGame#8156)
Implements GetHashCode to resolve build warnings. Related to issue https://github.com/MonoGame/monogame.github.io/issues/92
1 parent a27a95e commit da3568c

File tree

1 file changed

+12
-0
lines changed
  • MonoGame.Framework/Platform/SDL

1 file changed

+12
-0
lines changed

MonoGame.Framework/Platform/SDL/SDL2.cs

+12
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,18 @@ public override bool Equals(object obj)
168168
return version == (Version)obj;
169169
}
170170

171+
public override int GetHashCode()
172+
{
173+
unchecked
174+
{
175+
int hash = 17;
176+
hash = hash * 23 + Major.GetHashCode();
177+
hash = hash * 23 + Minor.GetHashCode();
178+
hash = hash * 23 + Patch.GetHashCode();
179+
return hash;
180+
}
181+
}
182+
171183
public static bool operator !=(Version version1, Version version2)
172184
{
173185
return !(version1 == version2);

0 commit comments

Comments
 (0)