[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:
hunuza 2008-12-12 14:16:24 +01:00
parent d386a67d27
commit 0f12997ef1
40 changed files with 108 additions and 108 deletions

View file

@ -313,13 +313,13 @@ class ObjectMgr
Guild* GetGuildByLeader(uint64 const&guid) const;
Guild* GetGuildById(const uint32 GuildId) const;
Guild* GetGuildByName(std::string guildname) const;
Guild* GetGuildByName(const std::string& guildname) const;
std::string GetGuildNameById(const uint32 GuildId) const;
void AddGuild(Guild* guild) { mGuildSet.insert( guild ); }
void RemoveGuild(Guild* guild) { mGuildSet.erase( guild ); }
ArenaTeam* GetArenaTeamById(const uint32 ArenaTeamId) const;
ArenaTeam* GetArenaTeamByName(std::string ArenaTeamName) const;
ArenaTeam* GetArenaTeamByName(const std::string& ArenaTeamName) const;
ArenaTeam* GetArenaTeamByCapitan(uint64 const& guid) const;
void AddArenaTeam(ArenaTeam* arenateam) { mArenaTeamSet.insert( arenateam ); }
void RemoveArenaTeam(ArenaTeam* arenateam) { mArenaTeamSet.erase( arenateam ); }
@ -405,7 +405,7 @@ class ObjectMgr
bool GetPlayerNameByGUID(const uint64 &guid, std::string &name) const;
uint32 GetPlayerTeamByGUID(const uint64 &guid) const;
uint32 GetPlayerAccountIdByGUID(const uint64 &guid) const;
uint32 GetPlayerAccountIdByPlayerName(std::string name) const;
uint32 GetPlayerAccountIdByPlayerName(const std::string& name) const;
uint32 GetNearestTaxiNode( float x, float y, float z, uint32 mapid );
void GetTaxiPath( uint32 source, uint32 destination, uint32 &path, uint32 &cost);
@ -698,15 +698,15 @@ class ObjectMgr
// reserved names
void LoadReservedPlayersNames();
bool IsReservedName(std::string name) const
bool IsReservedName(const std::string& name) const
{
return m_ReservedNames.find(name) != m_ReservedNames.end();
}
// name with valid structure and symbols
static bool IsValidName( std::string name, bool create = false );
static bool IsValidCharterName( std::string name );
static bool IsValidPetName( std::string name );
static bool IsValidName( const std::string& name, bool create = false );
static bool IsValidCharterName( const std::string& name );
static bool IsValidPetName( const std::string& name );
static bool CheckDeclinedNames(std::wstring mainpart, DeclinedName const& names);
@ -730,10 +730,10 @@ class ObjectMgr
if(itr==m_GameTeleMap.end()) return NULL;
return &itr->second;
}
GameTele const* GetGameTele(std::string name) const;
GameTele const* GetGameTele(const std::string& name) const;
GameTeleMap const& GetGameTeleMap() const { return m_GameTeleMap; }
bool AddGameTele(GameTele& data);
bool DeleteGameTele(std::string name);
bool DeleteGameTele(const std::string& name);
CacheNpcOptionList const& GetNpcOptions() const { return m_mCacheNpcOptionList; }