Browse Source

Removed Equal/GetHashCode from base classes

Tig 1 year ago
parent
commit
a89db3c5ab
2 changed files with 6 additions and 25 deletions
  1. 6 15
      Terminal.Gui/View/Layout/Dim.cs
  2. 0 10
      Terminal.Gui/View/Layout/Pos.cs

+ 6 - 15
Terminal.Gui/View/Layout/Dim.cs

@@ -278,6 +278,12 @@ public abstract class Dim
         return Math.Max (GetAnchor (superviewContentSize - location), 0);
     }
 
+    /// <summary>
+    ///     Diagnostics API to determine if this Dim object references other views.
+    /// </summary>
+    /// <returns></returns>
+    internal virtual bool ReferencesOtherViews () { return false; }
+
     #endregion virtual methods
 
     #region operators
@@ -326,21 +332,6 @@ public abstract class Dim
 
     #endregion operators
 
-    #region overrides
-
-    /// <summary>
-    ///     Diagnostics API to determine if this Dim object references other views.
-    /// </summary>
-    /// <returns></returns>
-    internal virtual bool ReferencesOtherViews () { return false; }
-
-    /// <inheritdoc/>
-    public override bool Equals (object? other) { return other is Dim abs && abs == this; }
-
-    /// <inheritdoc/>
-    public override int GetHashCode () { return GetAnchor (0).GetHashCode (); }
-
-    #endregion overrides
 }
 
 /// <summary>

+ 0 - 10
Terminal.Gui/View/Layout/Pos.cs

@@ -385,16 +385,6 @@ public abstract class Pos
 
     #endregion operators
 
-    #region overrides
-
-    /// <inheritdoc/>
-    public override bool Equals (object other) { return other is Pos abs && abs == this; }
-
-    /// <summary>Serves as the default hash function. </summary>
-    /// <returns>A hash code for the current object.</returns>
-    public override int GetHashCode () { return GetAnchor (0).GetHashCode (); }
-
-    #endregion overrides
 }
 
 /// <summary>