mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
Core/Misc: std::string -> std::string_view in a bunch of places, notably chat commands and Util.h
(cherry picked from commit a41bbd9ad9)
This commit is contained in:
@@ -441,7 +441,7 @@ public:
|
||||
return DoTeleport(handler, loc);
|
||||
}
|
||||
|
||||
static bool HandleGoInstanceCommand(ChatHandler* handler, std::vector<std::string> const& labels)
|
||||
static bool HandleGoInstanceCommand(ChatHandler* handler, std::vector<std::string_view> labels)
|
||||
{
|
||||
if (labels.empty())
|
||||
return false;
|
||||
@@ -453,7 +453,7 @@ public:
|
||||
uint32 count = 0;
|
||||
std::string const& scriptName = sObjectMgr->GetScriptName(pair.second.ScriptId);
|
||||
char const* mapName = ASSERT_NOTNULL(sMapStore.LookupEntry(pair.first))->MapName[handler->GetSessionDbcLocale()];
|
||||
for (auto const& label : labels)
|
||||
for (std::string_view label : labels)
|
||||
if (StringContainsStringI(scriptName, label))
|
||||
++count;
|
||||
|
||||
@@ -526,7 +526,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandleGoBossCommand(ChatHandler* handler, std::vector<std::string> const& needles)
|
||||
static bool HandleGoBossCommand(ChatHandler* handler, std::vector<std::string_view> needles)
|
||||
{
|
||||
if (needles.empty())
|
||||
return false;
|
||||
@@ -543,7 +543,7 @@ public:
|
||||
|
||||
uint32 count = 0;
|
||||
std::string const& scriptName = sObjectMgr->GetScriptName(data.ScriptID);
|
||||
for (auto const& label : needles)
|
||||
for (std::string_view label : needles)
|
||||
if (StringContainsStringI(scriptName, label) || StringContainsStringI(data.Name, label))
|
||||
++count;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user