diff --git a/src/tag/ParseName.cxx b/src/tag/ParseName.cxx index 74293df68..d5f872598 100644 --- a/src/tag/ParseName.cxx +++ b/src/tag/ParseName.cxx @@ -19,21 +19,19 @@ #include "ParseName.hxx" #include "util/ASCII.hxx" -#include "util/StringView.hxx" +#include "util/StringCompare.hxx" #include #include TagType -tag_name_parse(StringView name) noexcept +tag_name_parse(std::string_view name) noexcept { - assert(name != nullptr); - for (unsigned i = 0; i < TAG_NUM_OF_ITEM_TYPES; ++i) { assert(tag_item_names[i] != nullptr); - if (name.Equals(tag_item_names[i])) + if (name == tag_item_names[i]) return (TagType)i; } @@ -56,14 +54,12 @@ tag_name_parse_i(const char *name) noexcept } TagType -tag_name_parse_i(StringView name) noexcept +tag_name_parse_i(std::string_view name) noexcept { - assert(name != nullptr); - for (unsigned i = 0; i < TAG_NUM_OF_ITEM_TYPES; ++i) { assert(tag_item_names[i] != nullptr); - if (name.EqualsIgnoreCase(tag_item_names[i])) + if (StringIsEqualIgnoreCase(name, tag_item_names[i])) return (TagType)i; } diff --git a/src/tag/ParseName.hxx b/src/tag/ParseName.hxx index 67b1acf0a..aaace2071 100644 --- a/src/tag/ParseName.hxx +++ b/src/tag/ParseName.hxx @@ -22,7 +22,7 @@ #include "Type.h" -struct StringView; +#include /** * Parse the string, and convert it into a #TagType. Returns @@ -34,7 +34,7 @@ tag_name_parse(const char *name) noexcept; [[gnu::pure]] TagType -tag_name_parse(StringView name) noexcept; +tag_name_parse(std::string_view name) noexcept; /** * Parse the string, and convert it into a #TagType. Returns @@ -48,6 +48,6 @@ tag_name_parse_i(const char *name) noexcept; [[gnu::pure]] TagType -tag_name_parse_i(StringView name) noexcept; +tag_name_parse_i(std::string_view name) noexcept; #endif