diff options
author | megamage <none@none> | 2009-06-14 10:07:34 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-06-14 10:07:34 -0500 |
commit | a44a68acbb7d130ce8b8918ec023425cfdfb9335 (patch) | |
tree | 82be9d61f4956ad5cfe4c43cd02921eafc7ee1ce /src | |
parent | 314a4f8f00213b25b48d2aab277a6a6babf0af48 (diff) |
[8009] Pass const string reference to functions where possible. Author: hunuza
Avoids creating an unnecessary copy of strings.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Unit.cpp | 2 | ||||
-rw-r--r-- | src/game/Unit.h | 2 | ||||
-rw-r--r-- | src/game/World.h | 2 | ||||
-rw-r--r-- | src/game/WorldSession.h | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 1896655b50f..88c3630be22 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -12196,7 +12196,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 011a2a9940f..f5bc3fa1a1e 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -931,7 +931,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 3ff814a4d73..6e8479b59ef 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -452,7 +452,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 30be2efd304..5671ebecfd4 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -60,7 +60,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; |