mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[6899] Pass const reference instead of value for some strings in some functions.
Signed-off-by: hunuza <hunuza@gmail.com>
This commit is contained in:
parent
d386a67d27
commit
0f12997ef1
40 changed files with 108 additions and 108 deletions
|
|
@ -199,7 +199,7 @@ Guild * ObjectMgr::GetGuildById(const uint32 GuildId) const
|
|||
return NULL;
|
||||
}
|
||||
|
||||
Guild * ObjectMgr::GetGuildByName(std::string guildname) const
|
||||
Guild * ObjectMgr::GetGuildByName(const std::string& guildname) const
|
||||
{
|
||||
for(GuildSet::const_iterator itr = mGuildSet.begin(); itr != mGuildSet.end(); ++itr)
|
||||
if ((*itr)->GetName() == guildname)
|
||||
|
|
@ -235,7 +235,7 @@ ArenaTeam* ObjectMgr::GetArenaTeamById(const uint32 ArenaTeamId) const
|
|||
return NULL;
|
||||
}
|
||||
|
||||
ArenaTeam* ObjectMgr::GetArenaTeamByName(std::string arenateamname) const
|
||||
ArenaTeam* ObjectMgr::GetArenaTeamByName(const std::string& arenateamname) const
|
||||
{
|
||||
for(ArenaTeamSet::const_iterator itr = mArenaTeamSet.begin(); itr != mArenaTeamSet.end(); ++itr)
|
||||
if ((*itr)->GetName() == arenateamname)
|
||||
|
|
@ -1380,7 +1380,7 @@ uint32 ObjectMgr::GetPlayerAccountIdByGUID(const uint64 &guid) const
|
|||
return 0;
|
||||
}
|
||||
|
||||
uint32 ObjectMgr::GetPlayerAccountIdByPlayerName(std::string name) const
|
||||
uint32 ObjectMgr::GetPlayerAccountIdByPlayerName(const std::string& name) const
|
||||
{
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT account FROM characters WHERE name = '%s'", name.c_str());
|
||||
if(result)
|
||||
|
|
@ -6135,7 +6135,7 @@ bool isValidString(std::wstring wstr, uint32 strictMask, bool numericOrSpace, bo
|
|||
return false;
|
||||
}
|
||||
|
||||
bool ObjectMgr::IsValidName( std::string name, bool create )
|
||||
bool ObjectMgr::IsValidName( const std::string& name, bool create )
|
||||
{
|
||||
std::wstring wname;
|
||||
if(!Utf8toWStr(name,wname))
|
||||
|
|
@ -6149,7 +6149,7 @@ bool ObjectMgr::IsValidName( std::string name, bool create )
|
|||
return isValidString(wname,strictMask,false,create);
|
||||
}
|
||||
|
||||
bool ObjectMgr::IsValidCharterName( std::string name )
|
||||
bool ObjectMgr::IsValidCharterName( const std::string& name )
|
||||
{
|
||||
std::wstring wname;
|
||||
if(!Utf8toWStr(name,wname))
|
||||
|
|
@ -6163,7 +6163,7 @@ bool ObjectMgr::IsValidCharterName( std::string name )
|
|||
return isValidString(wname,strictMask,true);
|
||||
}
|
||||
|
||||
bool ObjectMgr::IsValidPetName( std::string name )
|
||||
bool ObjectMgr::IsValidPetName( const std::string& name )
|
||||
{
|
||||
std::wstring wname;
|
||||
if(!Utf8toWStr(name,wname))
|
||||
|
|
@ -6792,7 +6792,7 @@ void ObjectMgr::LoadGameTele()
|
|||
sLog.outString( ">> Loaded %u game tele's", count );
|
||||
}
|
||||
|
||||
GameTele const* ObjectMgr::GetGameTele(std::string name) const
|
||||
GameTele const* ObjectMgr::GetGameTele(const std::string& name) const
|
||||
{
|
||||
// explicit name case
|
||||
std::wstring wname;
|
||||
|
|
@ -6835,7 +6835,7 @@ bool ObjectMgr::AddGameTele(GameTele& tele)
|
|||
new_id,tele.position_x,tele.position_y,tele.position_z,tele.orientation,tele.mapId,tele.name.c_str());
|
||||
}
|
||||
|
||||
bool ObjectMgr::DeleteGameTele(std::string name)
|
||||
bool ObjectMgr::DeleteGameTele(const std::string& name)
|
||||
{
|
||||
// explicit name case
|
||||
std::wstring wname;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue