From 1060d7d73c5d8732ea5fd2b966a84d67cfd4e429 Mon Sep 17 00:00:00 2001 From: "H. Utku Maden" Date: Sun, 26 May 2024 11:13:14 +0300 Subject: [PATCH] Fix silly if statement. --- ReMime/Platform/UnixMediaTypeResolver.cs | 5 +---- ReMime/Platform/Win32MediaTypeResolver.cs | 10 +--------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/ReMime/Platform/UnixMediaTypeResolver.cs b/ReMime/Platform/UnixMediaTypeResolver.cs index e133106..9b8c8f9 100644 --- a/ReMime/Platform/UnixMediaTypeResolver.cs +++ b/ReMime/Platform/UnixMediaTypeResolver.cs @@ -47,10 +47,7 @@ namespace ReMime.Platform public bool TryResolve(string extension, out MediaType? mediaType) { - if (_extensionsMap.TryGetValue(extension, out mediaType)) - return true; - else - return false; + return _extensionsMap.TryGetValue(extension, out mediaType); } private static readonly char[] s_delimeters = new char[] { '\t', ' ' }; diff --git a/ReMime/Platform/Win32MediaTypeResolver.cs b/ReMime/Platform/Win32MediaTypeResolver.cs index bb5ddc4..adf2ad6 100644 --- a/ReMime/Platform/Win32MediaTypeResolver.cs +++ b/ReMime/Platform/Win32MediaTypeResolver.cs @@ -52,15 +52,7 @@ namespace ReMime.Platform public bool TryResolve(string extension, out MediaType? mediaType) { - if (_extensionsMap.TryGetValue(extension, out mediaType)) - { - return true; - } - else - { - mediaType = null; - return true; - } + return _extensionsMap.TryGetValue(extension, out mediaType); } } } \ No newline at end of file