Browse Source

Removing unnecessary GetHashCode indirection.

pull/59/head
Olivia 9 years ago
parent
commit
cdaf4d869b
  1. 13
      src/ImageSharp/Colors/Spaces/Bgra32.cs
  2. 13
      src/ImageSharp/Colors/Spaces/CieLab.cs
  3. 13
      src/ImageSharp/Colors/Spaces/CieXyz.cs
  4. 13
      src/ImageSharp/Colors/Spaces/Cmyk.cs
  5. 13
      src/ImageSharp/Colors/Spaces/Hsl.cs
  6. 13
      src/ImageSharp/Colors/Spaces/Hsv.cs
  7. 13
      src/ImageSharp/Colors/Spaces/YCbCr.cs

13
src/ImageSharp/Colors/Spaces/Bgra32.cs

@ -133,7 +133,7 @@ namespace ImageSharp.Colors.Spaces
/// <inheritdoc/>
public override int GetHashCode()
{
return GetHashCode(this);
return this.backingVector.GetHashCode();
}
/// <inheritdoc/>
@ -152,16 +152,5 @@ namespace ImageSharp.Colors.Spaces
{
return this.backingVector.Equals(other.backingVector);
}
/// <summary>
/// Returns the hash code for this instance.
/// </summary>
/// <param name="color">
/// The instance of <see cref="Bgra32"/> to return the hash code for.
/// </param>
/// <returns>
/// A 32-bit signed integer that is the hash code for this instance.
/// </returns>
private static int GetHashCode(Bgra32 color) => color.backingVector.GetHashCode();
}
}

13
src/ImageSharp/Colors/Spaces/CieLab.cs

@ -138,7 +138,7 @@ namespace ImageSharp.Colors.Spaces
/// <inheritdoc/>
public override int GetHashCode()
{
return GetHashCode(this);
return this.backingVector.GetHashCode();
}
/// <inheritdoc/>
@ -178,16 +178,5 @@ namespace ImageSharp.Colors.Spaces
&& result.Y < precision
&& result.Z < precision;
}
/// <summary>
/// Returns the hash code for this instance.
/// </summary>
/// <param name="color">
/// The instance of <see cref="CieLab"/> to return the hash code for.
/// </param>
/// <returns>
/// A 32-bit signed integer that is the hash code for this instance.
/// </returns>
private static int GetHashCode(CieLab color) => color.backingVector.GetHashCode();
}
}

13
src/ImageSharp/Colors/Spaces/CieXyz.cs

@ -129,7 +129,7 @@ namespace ImageSharp.Colors.Spaces
/// <inheritdoc/>
public override int GetHashCode()
{
return GetHashCode(this);
return this.backingVector.GetHashCode();
}
/// <inheritdoc/>
@ -169,16 +169,5 @@ namespace ImageSharp.Colors.Spaces
&& result.Y < precision
&& result.Z < precision;
}
/// <summary>
/// Returns the hash code for this instance.
/// </summary>
/// <param name="color">
/// The instance of <see cref="Hsv"/> to return the hash code for.
/// </param>
/// <returns>
/// A 32-bit signed integer that is the hash code for this instance.
/// </returns>
private static int GetHashCode(CieXyz color) => color.backingVector.GetHashCode();
}
}

13
src/ImageSharp/Colors/Spaces/Cmyk.cs

@ -139,7 +139,7 @@ namespace ImageSharp.Colors.Spaces
/// <inheritdoc/>
public override int GetHashCode()
{
return GetHashCode(this);
return this.backingVector.GetHashCode();
}
/// <inheritdoc/>
@ -180,16 +180,5 @@ namespace ImageSharp.Colors.Spaces
&& result.Z < precision
&& result.W < precision;
}
/// <summary>
/// Returns the hash code for this instance.
/// </summary>
/// <param name="color">
/// The instance of <see cref="Cmyk"/> to return the hash code for.
/// </param>
/// <returns>
/// A 32-bit signed integer that is the hash code for this instance.
/// </returns>
private static int GetHashCode(Cmyk color) => color.backingVector.GetHashCode();
}
}

13
src/ImageSharp/Colors/Spaces/Hsl.cs

@ -158,7 +158,7 @@ namespace ImageSharp.Colors.Spaces
/// <inheritdoc/>
public override int GetHashCode()
{
return GetHashCode(this);
return this.backingVector.GetHashCode();
}
/// <inheritdoc/>
@ -198,16 +198,5 @@ namespace ImageSharp.Colors.Spaces
&& result.Y < precision
&& result.Z < precision;
}
/// <summary>
/// Returns the hash code for this instance.
/// </summary>
/// <param name="color">
/// The instance of <see cref="Hsl"/> to return the hash code for.
/// </param>
/// <returns>
/// A 32-bit signed integer that is the hash code for this instance.
/// </returns>
private static int GetHashCode(Hsl color) => color.backingVector.GetHashCode();
}
}

13
src/ImageSharp/Colors/Spaces/Hsv.cs

@ -151,7 +151,7 @@ namespace ImageSharp.Colors.Spaces
/// <inheritdoc/>
public override int GetHashCode()
{
return GetHashCode(this);
return this.backingVector.GetHashCode();
}
/// <inheritdoc/>
@ -191,16 +191,5 @@ namespace ImageSharp.Colors.Spaces
&& result.Y < precision
&& result.Z < precision;
}
/// <summary>
/// Returns the hash code for this instance.
/// </summary>
/// <param name="color">
/// The instance of <see cref="Hsv"/> to return the hash code for.
/// </param>
/// <returns>
/// A 32-bit signed integer that is the hash code for this instance.
/// </returns>
private static int GetHashCode(Hsv color) => color.backingVector.GetHashCode();
}
}

13
src/ImageSharp/Colors/Spaces/YCbCr.cs

@ -121,7 +121,7 @@ namespace ImageSharp.Colors.Spaces
/// <inheritdoc/>
public override int GetHashCode()
{
return GetHashCode(this);
return this.backingVector.GetHashCode();
}
/// <inheritdoc/>
@ -151,16 +151,5 @@ namespace ImageSharp.Colors.Spaces
{
return this.backingVector.Equals(other.backingVector);
}
/// <summary>
/// Returns the hash code for this instance.
/// </summary>
/// <param name="color">
/// The instance of <see cref="YCbCr"/> to return the hash code for.
/// </param>
/// <returns>
/// A 32-bit signed integer that is the hash code for this instance.
/// </returns>
private static int GetHashCode(YCbCr color) => color.backingVector.GetHashCode();
}
}
Loading…
Cancel
Save