From cdaf4d869b4077147f93f170f414e11d1066b581 Mon Sep 17 00:00:00 2001 From: Olivia Date: Wed, 28 Dec 2016 13:26:07 +0200 Subject: [PATCH] Removing unnecessary GetHashCode indirection. --- src/ImageSharp/Colors/Spaces/Bgra32.cs | 13 +------------ src/ImageSharp/Colors/Spaces/CieLab.cs | 13 +------------ src/ImageSharp/Colors/Spaces/CieXyz.cs | 13 +------------ src/ImageSharp/Colors/Spaces/Cmyk.cs | 13 +------------ src/ImageSharp/Colors/Spaces/Hsl.cs | 13 +------------ src/ImageSharp/Colors/Spaces/Hsv.cs | 13 +------------ src/ImageSharp/Colors/Spaces/YCbCr.cs | 13 +------------ 7 files changed, 7 insertions(+), 84 deletions(-) diff --git a/src/ImageSharp/Colors/Spaces/Bgra32.cs b/src/ImageSharp/Colors/Spaces/Bgra32.cs index e590b9e388..4325b1cd64 100644 --- a/src/ImageSharp/Colors/Spaces/Bgra32.cs +++ b/src/ImageSharp/Colors/Spaces/Bgra32.cs @@ -133,7 +133,7 @@ namespace ImageSharp.Colors.Spaces /// public override int GetHashCode() { - return GetHashCode(this); + return this.backingVector.GetHashCode(); } /// @@ -152,16 +152,5 @@ namespace ImageSharp.Colors.Spaces { return this.backingVector.Equals(other.backingVector); } - - /// - /// 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 static int GetHashCode(Bgra32 color) => color.backingVector.GetHashCode(); } } diff --git a/src/ImageSharp/Colors/Spaces/CieLab.cs b/src/ImageSharp/Colors/Spaces/CieLab.cs index 78aa0dc70d..505c7a6905 100644 --- a/src/ImageSharp/Colors/Spaces/CieLab.cs +++ b/src/ImageSharp/Colors/Spaces/CieLab.cs @@ -138,7 +138,7 @@ namespace ImageSharp.Colors.Spaces /// public override int GetHashCode() { - return GetHashCode(this); + return this.backingVector.GetHashCode(); } /// @@ -178,16 +178,5 @@ namespace ImageSharp.Colors.Spaces && result.Y < precision && result.Z < precision; } - - /// - /// 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 static int GetHashCode(CieLab color) => color.backingVector.GetHashCode(); } } diff --git a/src/ImageSharp/Colors/Spaces/CieXyz.cs b/src/ImageSharp/Colors/Spaces/CieXyz.cs index 3a8704171d..2dd063163a 100644 --- a/src/ImageSharp/Colors/Spaces/CieXyz.cs +++ b/src/ImageSharp/Colors/Spaces/CieXyz.cs @@ -129,7 +129,7 @@ namespace ImageSharp.Colors.Spaces /// public override int GetHashCode() { - return GetHashCode(this); + return this.backingVector.GetHashCode(); } /// @@ -169,16 +169,5 @@ namespace ImageSharp.Colors.Spaces && result.Y < precision && result.Z < precision; } - - /// - /// 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 static int GetHashCode(CieXyz color) => color.backingVector.GetHashCode(); } } diff --git a/src/ImageSharp/Colors/Spaces/Cmyk.cs b/src/ImageSharp/Colors/Spaces/Cmyk.cs index 9e0f10898b..48bd5c83a0 100644 --- a/src/ImageSharp/Colors/Spaces/Cmyk.cs +++ b/src/ImageSharp/Colors/Spaces/Cmyk.cs @@ -139,7 +139,7 @@ namespace ImageSharp.Colors.Spaces /// public override int GetHashCode() { - return GetHashCode(this); + return this.backingVector.GetHashCode(); } /// @@ -180,16 +180,5 @@ namespace ImageSharp.Colors.Spaces && result.Z < precision && result.W < precision; } - - /// - /// 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 static int GetHashCode(Cmyk color) => color.backingVector.GetHashCode(); } } diff --git a/src/ImageSharp/Colors/Spaces/Hsl.cs b/src/ImageSharp/Colors/Spaces/Hsl.cs index 8c1d293021..67a0ef094e 100644 --- a/src/ImageSharp/Colors/Spaces/Hsl.cs +++ b/src/ImageSharp/Colors/Spaces/Hsl.cs @@ -158,7 +158,7 @@ namespace ImageSharp.Colors.Spaces /// public override int GetHashCode() { - return GetHashCode(this); + return this.backingVector.GetHashCode(); } /// @@ -198,16 +198,5 @@ namespace ImageSharp.Colors.Spaces && result.Y < precision && result.Z < precision; } - - /// - /// 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 static int GetHashCode(Hsl color) => color.backingVector.GetHashCode(); } } diff --git a/src/ImageSharp/Colors/Spaces/Hsv.cs b/src/ImageSharp/Colors/Spaces/Hsv.cs index eebf034ce9..4cd382e782 100644 --- a/src/ImageSharp/Colors/Spaces/Hsv.cs +++ b/src/ImageSharp/Colors/Spaces/Hsv.cs @@ -151,7 +151,7 @@ namespace ImageSharp.Colors.Spaces /// public override int GetHashCode() { - return GetHashCode(this); + return this.backingVector.GetHashCode(); } /// @@ -191,16 +191,5 @@ namespace ImageSharp.Colors.Spaces && result.Y < precision && result.Z < precision; } - - /// - /// 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 static int GetHashCode(Hsv color) => color.backingVector.GetHashCode(); } } diff --git a/src/ImageSharp/Colors/Spaces/YCbCr.cs b/src/ImageSharp/Colors/Spaces/YCbCr.cs index ada36c831e..a91fdb2d67 100644 --- a/src/ImageSharp/Colors/Spaces/YCbCr.cs +++ b/src/ImageSharp/Colors/Spaces/YCbCr.cs @@ -121,7 +121,7 @@ namespace ImageSharp.Colors.Spaces /// public override int GetHashCode() { - return GetHashCode(this); + return this.backingVector.GetHashCode(); } /// @@ -151,16 +151,5 @@ namespace ImageSharp.Colors.Spaces { return this.backingVector.Equals(other.backingVector); } - - /// - /// 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 static int GetHashCode(YCbCr color) => color.backingVector.GetHashCode(); } } \ No newline at end of file