diff options
author | Shauren <shauren.trinity@gmail.com> | 2022-11-20 14:55:17 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-11-20 14:55:17 +0100 |
commit | 9f753e97f4f80d386969e700dfad257030bce1ae (patch) | |
tree | 9ef162498d0a494a1c9eabb3e26cac22e60a3c07 /src | |
parent | 6856b248836205f3567d27848541859b93d93469 (diff) |
Core/Misc: Switch GetLocaleByName to use string_view
Diffstat (limited to 'src')
-rw-r--r-- | src/common/Common.cpp | 26 | ||||
-rw-r--r-- | src/common/Common.h | 2 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/common/Common.cpp b/src/common/Common.cpp index 1d1beddddc6..0cc12877db1 100644 --- a/src/common/Common.cpp +++ b/src/common/Common.cpp @@ -19,21 +19,21 @@ char const* localeNames[TOTAL_LOCALES] = { - "enUS", - "koKR", - "frFR", - "deDE", - "zhCN", - "zhTW", - "esES", - "esMX", - "ruRU", - "none", - "ptBR", - "itIT" + "enUS", + "koKR", + "frFR", + "deDE", + "zhCN", + "zhTW", + "esES", + "esMX", + "ruRU", + "none", + "ptBR", + "itIT" }; -LocaleConstant GetLocaleByName(std::string const& name) +LocaleConstant GetLocaleByName(std::string_view name) { for (uint32 i = 0; i < TOTAL_LOCALES; ++i) if (name == localeNames[i]) diff --git a/src/common/Common.h b/src/common/Common.h index efbb181737b..99807a713e2 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -121,7 +121,7 @@ enum class CascLocaleBit : uint8 TC_COMMON_API extern char const* localeNames[TOTAL_LOCALES]; -TC_COMMON_API LocaleConstant GetLocaleByName(std::string const& name); +TC_COMMON_API LocaleConstant GetLocaleByName(std::string_view name); TC_COMMON_API extern CascLocaleBit WowLocaleToCascLocaleBit[TOTAL_LOCALES]; |