Core: Pass by const reference for simple objects replaced with pass by value

This commit is contained in:
Spp-
2011-08-01 14:23:27 +02:00
parent 1fc1da842e
commit acd0fc79f6
63 changed files with 263 additions and 263 deletions
+24 -24
View File
@@ -308,7 +308,7 @@ void LFGMgr::Update(uint32 diff)
@param[in] guid Player or group guid to add to queue
@param[in] queueId Queue Id to add player/group to
*/
void LFGMgr::AddToQueue(const uint64& guid, uint8 queueId)
void LFGMgr::AddToQueue(const uint64 guid, uint8 queueId)
{
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP))
queueId = 0;
@@ -329,7 +329,7 @@ void LFGMgr::AddToQueue(const uint64& guid, uint8 queueId)
@param[in] guid Player or group guid to add to queue
@return true if guid was found in main queue.
*/
bool LFGMgr::RemoveFromQueue(const uint64& guid)
bool LFGMgr::RemoveFromQueue(const uint64 guid)
{
for (LfgGuidListMap::iterator it = m_currentQueue.begin(); it != m_currentQueue.end(); ++it)
it->second.remove(guid);
@@ -982,7 +982,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal)
@param[in] guid Player guid (0 = rolecheck failed)
@param[in] roles Player selected roles
*/
void LFGMgr::UpdateRoleCheck(uint64& gguid, uint64 guid /* = 0 */, uint8 roles /* = ROLE_NONE */)
void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /* = ROLE_NONE */)
{
if (!gguid)
return;
@@ -1247,7 +1247,7 @@ bool LFGMgr::CheckGroupRoles(LfgRolesMap& groles, bool removeLeaderFlag /*= true
@param[in] guid Player guid to update answer
@param[in] accept Player answer
*/
void LFGMgr::UpdateProposal(uint32 proposalId, const uint64& guid, bool accept)
void LFGMgr::UpdateProposal(uint32 proposalId, const uint64 guid, bool accept)
{
// Check if the proposal exists
LfgProposalMap::iterator itProposal = m_Proposals.find(proposalId);
@@ -1516,7 +1516,7 @@ void LFGMgr::RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType t
@param[in] victim Victim guid
@param[in] reason Kick reason
*/
void LFGMgr::InitBoot(Group* grp, const uint64& kicker, const uint64& victim, std::string reason)
void LFGMgr::InitBoot(Group* grp, const uint64 kicker, const uint64 victim, std::string reason)
{
if (!grp)
return;
@@ -1886,7 +1886,7 @@ std::string LFGMgr::ConcatenateGuids(LfgGuidList check)
return o.str();
}
LfgState LFGMgr::GetState(const uint64& guid)
LfgState LFGMgr::GetState(const uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetState: [" UI64FMTD "]", guid);
if (IS_GROUP(guid))
@@ -1895,61 +1895,61 @@ LfgState LFGMgr::GetState(const uint64& guid)
return m_Players[guid].GetState();
}
uint32 LFGMgr::GetDungeon(const uint64& guid, bool asId /*= true*/)
uint32 LFGMgr::GetDungeon(const uint64 guid, bool asId /*= true*/)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetDungeon: [" UI64FMTD "] asId: %u", guid, asId);
return m_Groups[guid].GetDungeon(asId);
}
uint8 LFGMgr::GetRoles(const uint64& guid)
uint8 LFGMgr::GetRoles(const uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetRoles: [" UI64FMTD "]", guid);
return m_Players[guid].GetRoles();
}
const std::string& LFGMgr::GetComment(const uint64& guid)
const std::string& LFGMgr::GetComment(const uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetComment: [" UI64FMTD "]", guid);
return m_Players[guid].GetComment();
}
const LfgDungeonSet& LFGMgr::GetSelectedDungeons(const uint64& guid)
const LfgDungeonSet& LFGMgr::GetSelectedDungeons(const uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid);
return m_Players[guid].GetSelectedDungeons();
}
const LfgLockMap& LFGMgr::GetLockedDungeons(const uint64& guid)
const LfgLockMap& LFGMgr::GetLockedDungeons(const uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetLockedDungeons: [" UI64FMTD "]", guid);
return m_Players[guid].GetLockedDungeons();
}
uint8 LFGMgr::GetKicksLeft(const uint64& guid)
uint8 LFGMgr::GetKicksLeft(const uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetKicksLeft: [" UI64FMTD "]", guid);
return m_Groups[guid].GetKicksLeft();
}
uint8 LFGMgr::GetVotesNeeded(const uint64& guid)
uint8 LFGMgr::GetVotesNeeded(const uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetVotesNeeded: [" UI64FMTD "]", guid);
return m_Groups[guid].GetVotesNeeded();
}
void LFGMgr::RestoreState(const uint64& guid)
void LFGMgr::RestoreState(const uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RestoreState: [" UI64FMTD "]", guid);
m_Groups[guid].RestoreState();
}
void LFGMgr::ClearState(const uint64& guid)
void LFGMgr::ClearState(const uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::ClearState: [" UI64FMTD "]", guid);
m_Players[guid].ClearState();
}
void LFGMgr::SetState(const uint64& guid, LfgState state)
void LFGMgr::SetState(const uint64 guid, LfgState state)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetState: [" UI64FMTD "] state %u", guid, state);
if (IS_GROUP(guid))
@@ -1958,43 +1958,43 @@ void LFGMgr::SetState(const uint64& guid, LfgState state)
m_Players[guid].SetState(state);
}
void LFGMgr::SetDungeon(const uint64& guid, uint32 dungeon)
void LFGMgr::SetDungeon(const uint64 guid, uint32 dungeon)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetDungeon: [" UI64FMTD "] dungeon %u", guid, dungeon);
m_Groups[guid].SetDungeon(dungeon);
}
void LFGMgr::SetRoles(const uint64& guid, uint8 roles)
void LFGMgr::SetRoles(const uint64 guid, uint8 roles)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetRoles: [" UI64FMTD "] roles: %u", guid, roles);
m_Players[guid].SetRoles(roles);
}
void LFGMgr::SetComment(const uint64& guid, const std::string& comment)
void LFGMgr::SetComment(const uint64 guid, const std::string& comment)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetComment: [" UI64FMTD "] comment: %s", guid, comment.c_str());
m_Players[guid].SetComment(comment);
}
void LFGMgr::SetSelectedDungeons(const uint64& guid, const LfgDungeonSet& dungeons)
void LFGMgr::SetSelectedDungeons(const uint64 guid, const LfgDungeonSet& dungeons)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetSelectedDungeons: [" UI64FMTD "]", guid);
m_Players[guid].SetSelectedDungeons(dungeons);
}
void LFGMgr::SetLockedDungeons(const uint64& guid, const LfgLockMap& lock)
void LFGMgr::SetLockedDungeons(const uint64 guid, const LfgLockMap& lock)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid);
m_Players[guid].SetLockedDungeons(lock);
}
void LFGMgr::DecreaseKicksLeft(const uint64& guid)
void LFGMgr::DecreaseKicksLeft(const uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::DecreaseKicksLeft: [" UI64FMTD "]", guid);
m_Groups[guid].DecreaseKicksLeft();
}
void LFGMgr::RemovePlayerData(const uint64& guid)
void LFGMgr::RemovePlayerData(const uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemovePlayerData: [" UI64FMTD "]", guid);
LfgPlayerDataMap::iterator it = m_Players.find(guid);
@@ -2002,7 +2002,7 @@ void LFGMgr::RemovePlayerData(const uint64& guid)
m_Players.erase(it);
}
void LFGMgr::RemoveGroupData(const uint64& guid)
void LFGMgr::RemoveGroupData(const uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveGroupData: [" UI64FMTD "]", guid);
LfgGroupDataMap::iterator it = m_Groups.find(guid);
+24 -24
View File
@@ -269,48 +269,48 @@ class LFGMgr
void Leave(Player* plr, Group* grp = NULL);
// Role Check
void UpdateRoleCheck(uint64& gguid, uint64 guid = 0, uint8 roles = ROLE_NONE);
void UpdateRoleCheck(uint64 gguid, uint64 guid = 0, uint8 roles = ROLE_NONE);
// Proposals
void UpdateProposal(uint32 proposalId, const uint64& guid, bool accept);
void UpdateProposal(uint32 proposalId, const uint64 guid, bool accept);
// Teleportation
void TeleportPlayer(Player* plr, bool out, bool fromOpcode = false);
// Vote kick
void InitBoot(Group* grp, const uint64& kguid, const uint64& vguid, std::string reason);
void InitBoot(Group* grp, const uint64 kguid, const uint64 vguid, std::string reason);
void UpdateBoot(Player* plr, bool accept);
void OfferContinue(Group* grp);
void InitializeLockedDungeons(Player* plr);
void SetComment(const uint64& guid, const std::string& comment);
const LfgLockMap& GetLockedDungeons(const uint64& guid);
LfgState GetState(const uint64& guid);
const LfgDungeonSet& GetSelectedDungeons(const uint64& guid);
uint32 GetDungeon(const uint64& guid, bool asId = true);
void ClearState(const uint64& guid);
void RemovePlayerData(const uint64& guid);
void RemoveGroupData(const uint64& guid);
uint8 GetKicksLeft(const uint64& gguid);
uint8 GetVotesNeeded(const uint64& gguid);
void SetRoles(const uint64& guid, uint8 roles);
void SetComment(const uint64 guid, const std::string& comment);
const LfgLockMap& GetLockedDungeons(const uint64 guid);
LfgState GetState(const uint64 guid);
const LfgDungeonSet& GetSelectedDungeons(const uint64 guid);
uint32 GetDungeon(const uint64 guid, bool asId = true);
void ClearState(const uint64 guid);
void RemovePlayerData(const uint64 guid);
void RemoveGroupData(const uint64 guid);
uint8 GetKicksLeft(const uint64 gguid);
uint8 GetVotesNeeded(const uint64 gguid);
void SetRoles(const uint64 guid, uint8 roles);
private:
uint8 GetRoles(const uint64& guid);
const std::string& GetComment(const uint64& gguid);
void RestoreState(const uint64& guid);
void SetState(const uint64& guid, LfgState state);
void SetDungeon(const uint64& guid, uint32 dungeon);
void SetSelectedDungeons(const uint64& guid, const LfgDungeonSet& dungeons);
void SetLockedDungeons(const uint64& guid, const LfgLockMap& lock);
void DecreaseKicksLeft(const uint64& guid);
uint8 GetRoles(const uint64 guid);
const std::string& GetComment(const uint64 gguid);
void RestoreState(const uint64 guid);
void SetState(const uint64 guid, LfgState state);
void SetDungeon(const uint64 guid, uint32 dungeon);
void SetSelectedDungeons(const uint64 guid, const LfgDungeonSet& dungeons);
void SetLockedDungeons(const uint64 guid, const LfgLockMap& lock);
void DecreaseKicksLeft(const uint64 guid);
void NoExiste(uint8 lala);
// Queue
void AddToQueue(const uint64& guid, uint8 queueId);
bool RemoveFromQueue(const uint64& guid);
void AddToQueue(const uint64 guid, uint8 queueId);
bool RemoveFromQueue(const uint64 guid);
// Proposals
void RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType type);