diff --git a/src/SixLabors.Core/Primitives/Size.cs b/src/SixLabors.Core/Primitives/Size.cs
index d5ff95ad5a..86412a1373 100644
--- a/src/SixLabors.Core/Primitives/Size.cs
+++ b/src/SixLabors.Core/Primitives/Size.cs
@@ -252,17 +252,17 @@ namespace SixLabors.Primitives
public static Size Truncate(SizeF size) => new Size(unchecked((int)size.Width), unchecked((int)size.Height));
///
- public override int GetHashCode() => this.GetHashCode(this);
+ public override int GetHashCode() => HashHelpers.Combine(this.Width.GetHashCode(), this.Height.GetHashCode());
///
public override string ToString() => $"Size [ Width={this.Width}, Height={this.Height} ]";
///
- public override bool Equals(object obj) => obj is Size && this.Equals((Size)obj);
+ public override bool Equals(object obj) => obj is Size other && this.Equals(other);
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- public bool Equals(Size other) => this.Width == other.Width && this.Height == other.Height;
+ public bool Equals(Size other) => this.Width.Equals(other.Width) && this.Height.Equals(other.Height);
///
/// Multiplies by an producing .
@@ -281,16 +281,5 @@ namespace SixLabors.Primitives
/// Product of type SizeF.
private static SizeF Multiply(Size size, float multiplier) =>
new SizeF(size.Width * multiplier, size.Height * multiplier);
-
- ///
- /// Returns the hash code for this instance.
- ///
- ///
- /// The instance of to return the hash code for.
- ///
- ///
- /// A 32-bit signed integer that is the hash code for this instance.
- ///
- private int GetHashCode(Size size) => HashHelpers.Combine(size.Width.GetHashCode(), size.Height.GetHashCode());
}
}
\ No newline at end of file