Browse Source

Simplify GetHashCode

Brandon Thetford 1 year ago
parent
commit
17a565ed74
1 changed files with 1 additions and 8 deletions
  1. 1 8
      Terminal.Gui/Drawing/ColorScheme.cs

+ 1 - 8
Terminal.Gui/Drawing/ColorScheme.cs

@@ -100,14 +100,7 @@ public record ColorScheme : IEqualityOperators<ColorScheme, ColorScheme, bool>
     /// <returns>hashcode for this instance</returns>
     public override int GetHashCode ()
     {
-        int hashCode = -1242460230;
-        hashCode = hashCode * -1521134295 + _normal.GetHashCode ();
-        hashCode = hashCode * -1521134295 + _focus.GetHashCode ();
-        hashCode = hashCode * -1521134295 + _hotNormal.GetHashCode ();
-        hashCode = hashCode * -1521134295 + _hotFocus.GetHashCode ();
-        hashCode = hashCode * -1521134295 + _disabled.GetHashCode ();
-
-        return hashCode;
+        return HashCode.Combine (_normal, _focus, _hotNormal, _hotFocus, _disabled);
     }
 
     /// <inheritdoc/>