diff --git a/src/tag/Table.cxx b/src/tag/Table.cxx index acec161b6..76c50ccc4 100644 --- a/src/tag/Table.cxx +++ b/src/tag/Table.cxx @@ -19,7 +19,7 @@ #include "Table.hxx" #include "util/ASCII.hxx" -#include "util/StringView.hxx" +#include "util/StringCompare.hxx" #include @@ -39,10 +39,10 @@ tag_table_lookup(const struct tag_table *table, const char *name) noexcept } TagType -tag_table_lookup(const struct tag_table *table, StringView name) noexcept +tag_table_lookup(const struct tag_table *table, std::string_view name) noexcept { for (; table->name != nullptr; ++table) - if (name.Equals(table->name)) + if (name == table->name) return table->type; return TAG_NUM_OF_ITEM_TYPES; @@ -64,10 +64,11 @@ tag_table_lookup_i(const struct tag_table *table, const char *name) noexcept } TagType -tag_table_lookup_i(const struct tag_table *table, StringView name) noexcept +tag_table_lookup_i(const struct tag_table *table, + std::string_view name) noexcept { for (; table->name != nullptr; ++table) - if (name.EqualsIgnoreCase(table->name)) + if (StringIsEqualIgnoreCase(name, table->name)) return table->type; return TAG_NUM_OF_ITEM_TYPES; diff --git a/src/tag/Table.hxx b/src/tag/Table.hxx index 128905e8e..e9f0eb004 100644 --- a/src/tag/Table.hxx +++ b/src/tag/Table.hxx @@ -22,7 +22,7 @@ #include "Type.h" -struct StringView; +#include struct tag_table { const char *name; @@ -41,7 +41,7 @@ tag_table_lookup(const tag_table *table, const char *name) noexcept; [[gnu::pure]] TagType -tag_table_lookup(const tag_table *table, StringView name) noexcept; +tag_table_lookup(const tag_table *table, std::string_view name) noexcept; /** * Looks up a string in a tag translation table (case insensitive). @@ -54,7 +54,7 @@ tag_table_lookup_i(const tag_table *table, const char *name) noexcept; [[gnu::pure]] TagType -tag_table_lookup_i(const tag_table *table, StringView name) noexcept; +tag_table_lookup_i(const tag_table *table, std::string_view name) noexcept; /** * Looks up a #TagType in a tag translation table and returns its