aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Texts/CreatureTextMgr.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-04-30 14:04:28 +0200
committerShauren <shauren.trinity@gmail.com>2023-04-30 14:04:28 +0200
commit8f7a1d3c2c59b72d193e5eeed065ebd8f13d4ecc (patch)
tree121cfb5906cc0ca6e8a6a0cd3b764210579a5a8f /src/server/game/Texts/CreatureTextMgr.cpp
parent7f5e47c396e49da2530aabac05f7ca3c0f177298 (diff)
Core/Misc: Delay creating std::string objects for locale data after size validation
Diffstat (limited to 'src/server/game/Texts/CreatureTextMgr.cpp')
-rw-r--r--src/server/game/Texts/CreatureTextMgr.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp
index b86c14d28b1..46976e70d96 100644
--- a/src/server/game/Texts/CreatureTextMgr.cpp
+++ b/src/server/game/Texts/CreatureTextMgr.cpp
@@ -154,17 +154,17 @@ void CreatureTextMgr::LoadCreatureTextLocales()
{
Field* fields = result->Fetch();
- uint32 creatureId = fields[0].GetUInt32();
- uint32 groupId = fields[1].GetUInt8();
- uint32 id = fields[2].GetUInt8();
- std::string localeName = fields[3].GetString();
+ uint32 creatureId = fields[0].GetUInt32();
+ uint32 groupId = fields[1].GetUInt8();
+ uint32 id = fields[2].GetUInt8();
+ std::string_view localeName = fields[3].GetStringView();
LocaleConstant locale = GetLocaleByName(localeName);
if (!IsValidLocale(locale) || locale == LOCALE_enUS)
continue;
CreatureTextLocale& data = mLocaleTextMap[CreatureTextId(creatureId, groupId, id)];
- ObjectMgr::AddLocaleString(fields[4].GetString(), locale, data.Text);
+ ObjectMgr::AddLocaleString(fields[4].GetStringView(), locale, data.Text);
} while (result->NextRow());
TC_LOG_INFO("server.loading", ">> Loaded {} creature localized texts in {} ms", uint32(mLocaleTextMap.size()), GetMSTimeDiffToNow(oldMSTime));