From bb009daf66372ffa102d432df2643502891cbe6c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 4 Nov 2020 13:34:02 +0100 Subject: [PATCH] playlist/registry: simplify ExtractMimeTypeMainPart() --- src/playlist/PlaylistRegistry.cxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/playlist/PlaylistRegistry.cxx b/src/playlist/PlaylistRegistry.cxx index 9aa87b73b..5b7ef71d3 100644 --- a/src/playlist/PlaylistRegistry.cxx +++ b/src/playlist/PlaylistRegistry.cxx @@ -207,11 +207,7 @@ gcc_pure static StringView ExtractMimeTypeMainPart(StringView s) noexcept { - const auto separator = s.Find(';'); - if (separator != nullptr) - s.SetEnd(separator); - - return s; + return s.Split(';').first; } static std::unique_ptr