From 0ccc87eed30777a512bd8ab86504076e0fa8821a Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 2 Jul 2021 13:01:40 +0200 Subject: [PATCH] Minor code style tweaks --- .../Graphics/Helpers/WICFormatHelper.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs b/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs index 19b5716e..37e45512 100644 --- a/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs +++ b/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs @@ -113,20 +113,20 @@ namespace ComputeSharp.Graphics.Helpers [Pure] public static Guid GetForFilename(ReadOnlySpan filename) { - switch (Path.GetExtension(filename).ToString()) + return Path.GetExtension(filename).ToString() switch { - case ".bmp": return FX.GUID_ContainerFormatBmp; - case ".png": return FX.GUID_ContainerFormatPng; - case ".jpg": - case ".jpeg": return FX.GUID_ContainerFormatJpeg; - case ".jxr": - case ".hdp": - case ".wdp": - case ".wmp": return FX.GUID_ContainerFormatWmp; - case ".tiff": return FX.GUID_ContainerFormatTiff; - case ".dds": return FX.GUID_ContainerFormatDds; - default: return ThrowHelper.ThrowArgumentException("Invalid filename"); - } + ".bmp" => FX.GUID_ContainerFormatBmp, + ".png" => FX.GUID_ContainerFormatPng, + ".jpg" or + ".jpeg" => FX.GUID_ContainerFormatJpeg, + ".jxr" or + ".hdp" or + ".wdp" or + ".wmp" => FX.GUID_ContainerFormatWmp, + ".tiff" => FX.GUID_ContainerFormatTiff, + ".dds" => FX.GUID_ContainerFormatDds, + _ => ThrowHelper.ThrowArgumentException("Invalid filename"), + }; } } }