From a34e7857f186c15217c96081a3317b01a9a17c6b Mon Sep 17 00:00:00 2001 From: hunuza Date: Sun, 14 Jun 2009 11:12:34 +0200 Subject: [PATCH] [8009] Pass const string reference to functions where possible. Avoids creating an unnecessary copy of strings. Signed-off-by: hunuza --- src/game/Unit.cpp | 2 +- src/game/Unit.h | 2 +- src/game/World.h | 2 +- src/game/WorldSession.h | 2 +- src/shared/revision_nr.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 02f477520..8f78975ed 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10495,7 +10495,7 @@ void CharmInfo::SetPetNumber(uint32 petnumber, bool statwindow) m_unit->SetUInt32Value(UNIT_FIELD_PETNUMBER, 0); } -void CharmInfo::LoadPetActionBar( std::string data ) +void CharmInfo::LoadPetActionBar(const std::string& data ) { InitPetActionBar(); diff --git a/src/game/Unit.h b/src/game/Unit.h index d6dac29c9..11babf746 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -823,7 +823,7 @@ struct CharmInfo //return true if successful bool AddSpellToActionBar(uint32 spellid, ActiveStates newstate = ACT_DECIDE); bool RemoveSpellFromActionBar(uint32 spell_id); - void LoadPetActionBar(std::string data); + void LoadPetActionBar(const std::string& data); void BuildActionBar(WorldPacket* data); void SetSpellAutocast(uint32 spell_id, bool state); void SetActionBar(uint8 index, uint32 spellOrAction,ActiveStates type) diff --git a/src/game/World.h b/src/game/World.h index 19106df19..5fdfb00ad 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -404,7 +404,7 @@ class World void SetAllowMovement(bool allow) { m_allowMovement = allow; } /// Set a new Message of the Day - void SetMotd(std::string motd) { m_motd = motd; } + void SetMotd(const std::string& motd) { m_motd = motd; } /// Get the current Message of the Day const char* GetMotd() const { return m_motd.c_str(); } diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index 7f78c4897..c61e44a7b 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -58,7 +58,7 @@ struct AccountData struct AddonInfo { - AddonInfo(std::string name, uint8 enabled, uint32 crc) + AddonInfo(const std::string& name, uint8 enabled, uint32 crc) { Name = name; Enabled = enabled; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 52be6cdd8..b0a164871 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8008" + #define REVISION_NR "8009" #endif // __REVISION_NR_H__