@ -194,12 +194,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override bool Equals(object obj)
{
if (obj is CieLab)
return this.Equals((CieLab)obj);
}
return false;
return obj is CieLab other && this.Equals(other);
/// <inheritdoc/>
@ -104,7 +104,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return obj is IccChromaticityTagDataEntry && this.Equals((IccChromaticityTagDataEntry)obj);
return obj is IccChromaticityTagDataEntry other && this.Equals(other);
@ -60,7 +60,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return obj is IccDateTimeTagDataEntry && this.Equals((IccDateTimeTagDataEntry)obj);
return obj is IccDateTimeTagDataEntry other && this.Equals(other);
@ -77,17 +77,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc />
if (obj is null)
if (ReferenceEquals(this, obj))
return true;
return obj is IccResponseCurveSet16TagDataEntry && this.Equals((IccResponseCurveSet16TagDataEntry)obj);
return obj is IccResponseCurveSet16TagDataEntry other && this.Equals(other);
@ -80,7 +80,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return obj is IccViewingConditionsTagDataEntry && this.Equals((IccViewingConditionsTagDataEntry)obj);
return obj is IccViewingConditionsTagDataEntry other && this.Equals(other);
@ -77,7 +77,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
return obj is IccScreeningChannel && this.Equals((IccScreeningChannel)obj);
return obj is IccScreeningChannel other && this.Equals(other);
@ -206,7 +206,7 @@ namespace SixLabors.ImageSharp.PixelFormats
return (obj is Bgr565) && this.Equals((Bgr565)obj);
return obj is Bgr565 other && this.Equals(other);
@ -211,7 +211,7 @@ namespace SixLabors.ImageSharp.PixelFormats
return (obj is HalfSingle) && this.Equals((HalfSingle)obj);
return obj is HalfSingle other && this.Equals(other);
@ -239,7 +239,7 @@ namespace SixLabors.ImageSharp.PixelFormats
return (obj is HalfVector2) && this.Equals((HalfVector2)obj);
return obj is HalfVector2 other && this.Equals(other);
@ -247,7 +247,7 @@ namespace SixLabors.ImageSharp.PixelFormats
return (obj is NormalizedShort2) && this.Equals((NormalizedShort2)obj);
return obj is NormalizedShort2 other && this.Equals(other);
@ -210,7 +210,7 @@ namespace SixLabors.ImageSharp.PixelFormats
return (obj is Rg32) && this.Equals((Rg32)obj);
return obj is Rg32 other && this.Equals(other);
@ -46,8 +46,7 @@ namespace SixLabors.ImageSharp.Tests.Memory
if (ReferenceEquals(null, obj)) return false;
return obj is CustomStruct && this.Equals((CustomStruct)obj);
return obj is CustomStruct other && this.Equals(other);
public override int GetHashCode()