From 9a7dd3c2ff8f0ba5a01233cb36fdc93994b76e0a Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 14 Jan 2023 14:01:27 +0100 Subject: [PATCH] Skip unnecessary ToString() call to check file extension --- src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs b/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs index ec08b097..1f0e0921 100644 --- a/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs +++ b/src/ComputeSharp/Graphics/Helpers/WICFormatHelper.cs @@ -116,7 +116,7 @@ internal static class WICFormatHelper /// Thrown when the input filename doesn't have a valid file extension. public static Guid GetForFilename(ReadOnlySpan filename) { - return Path.GetExtension(filename).ToString() switch + return Path.GetExtension(filename) switch { ".bmp" => GUID.GUID_ContainerFormatBmp, ".png" => GUID.GUID_ContainerFormatPng,