Browse Source

Use pattern matching

af/merge-core
Jason Nelson 8 years ago
parent
commit
e0612ad200
  1. 2
      src/ImageSharp/PixelFormats/Rgba1010102.cs
  2. 2
      src/ImageSharp/PixelFormats/Rgba32.cs
  3. 2
      src/ImageSharp/PixelFormats/Rgba64.cs

2
src/ImageSharp/PixelFormats/Rgba1010102.cs

@ -188,7 +188,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc /> /// <inheritdoc />
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
return (obj is Rgba1010102) && this.Equals((Rgba1010102)obj); return obj is Rgba1010102 other && this.Equals(other);
} }
/// <inheritdoc /> /// <inheritdoc />

2
src/ImageSharp/PixelFormats/Rgba32.cs

@ -387,7 +387,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc/> /// <inheritdoc/>
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
return (obj is Rgba32) && this.Equals((Rgba32)obj); return obj is Rgba32 other && this.Equals(other);
} }
/// <inheritdoc/> /// <inheritdoc/>

2
src/ImageSharp/PixelFormats/Rgba64.cs

@ -187,7 +187,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc /> /// <inheritdoc />
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
return (obj is Rgba64) && this.Equals((Rgba64)obj); return obj is Rgba64 other && this.Equals(other);
} }
/// <inheritdoc /> /// <inheritdoc />

Loading…
Cancel
Save