Skip to content

Commit d5b300e

Browse files
committed
Use switch statement instead.
1 parent 638de71 commit d5b300e

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/Magick.NET.SystemDrawing/IMagickImageExtentions.cs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,12 @@ private static Density GetDefaultDensity(IMagickImage image, DensityUnit units)
168168
}
169169

170170
private static string GetMapping(PixelFormat format)
171-
{
172-
switch (format)
171+
=> format switch
173172
{
174-
case PixelFormat.Format24bppRgb:
175-
return "BGR";
176-
case PixelFormat.Format32bppArgb:
177-
return "BGRA";
178-
default:
179-
throw new NotImplementedException(format.ToString());
180-
}
181-
}
173+
PixelFormat.Format24bppRgb => "BGR",
174+
PixelFormat.Format32bppArgb => "BGRA",
175+
_ => throw new NotImplementedException(format.ToString()),
176+
};
182177

183178
private static bool IsSupportedImageFormat(ImageFormat format)
184179
=> format.Guid.Equals(ImageFormat.Bmp.Guid) ||

0 commit comments

Comments
 (0)