playlist/registry: remove duplicate function ExtractMimeTypeMainPart()

This is the same as GetMimeTypeBase(), which has already been applied.
This commit is contained in:
Max Kellermann 2020-11-04 21:20:15 +01:00
parent bb07fd42ce
commit 51e5b56b3a
1 changed files with 2 additions and 13 deletions

View File

@ -215,23 +215,12 @@ playlist_list_open_stream_mime2(InputStreamPtr &&is, StringView mime)
return nullptr;
}
/**
* Extract the "main" part of a MIME type string, i.e. the portion
* before the semicolon (if one exists).
*/
gcc_pure
static StringView
ExtractMimeTypeMainPart(StringView s) noexcept
{
return s.Split(';').first;
}
static std::unique_ptr<SongEnumerator>
playlist_list_open_stream_mime(InputStreamPtr &&is, std::string_view full_mime)
playlist_list_open_stream_mime(InputStreamPtr &&is, std::string_view mime)
{
/* probe only the portion before the semicolon*/
return playlist_list_open_stream_mime2(std::move(is),
ExtractMimeTypeMainPart(full_mime));
mime);
}
std::unique_ptr<SongEnumerator>