tag/Handler: use StringIsEqualIgnoreCase()

This commit is contained in:
Max Kellermann 2022-06-30 10:38:38 +02:00
parent 232084c2f9
commit c34f3c9b94
2 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,7 @@
#include "TagFile.hxx" #include "TagFile.hxx"
#include "fs/Traits.hxx" #include "fs/Traits.hxx"
#include "fs/AllocatedPath.hxx" #include "fs/AllocatedPath.hxx"
#include "util/StringView.hxx" #include "util/StringCompare.hxx"
#include <memory> #include <memory>
@ -77,8 +77,7 @@ public:
void void
ExtractCuesheetTagHandler::OnPair(std::string_view name, std::string_view value) noexcept ExtractCuesheetTagHandler::OnPair(std::string_view name, std::string_view value) noexcept
{ {
if (cuesheet.empty() && if (cuesheet.empty() && StringIsEqualIgnoreCase(name, "cuesheet"sv))
StringView{name}.EqualsIgnoreCase("cuesheet"sv))
cuesheet = value; cuesheet = value;
} }

View File

@ -21,6 +21,7 @@
#include "Builder.hxx" #include "Builder.hxx"
#include "pcm/AudioFormat.hxx" #include "pcm/AudioFormat.hxx"
#include "util/CharUtil.hxx" #include "util/CharUtil.hxx"
#include "util/StringCompare.hxx"
#include "util/StringView.hxx" #include "util/StringView.hxx"
#include <algorithm> #include <algorithm>
@ -81,7 +82,7 @@ AddTagHandler::OnTag(TagType type, std::string_view value) noexcept
void void
FullTagHandler::OnPair(std::string_view name, std::string_view) noexcept FullTagHandler::OnPair(std::string_view name, std::string_view) noexcept
{ {
if (StringView{name}.EqualsIgnoreCase("cuesheet"sv)) if (StringIsEqualIgnoreCase(name, "cuesheet"sv))
tag.SetHasPlaylist(true); tag.SetHasPlaylist(true);
} }