[8009] Pass const string reference to functions where possible. Author: hunuza
Avoids creating an unnecessary copy of strings. --HG-- branch : trunk
This commit is contained in:
+1
-1
@@ -12196,7 +12196,7 @@ void CharmInfo::SetPetNumber(uint32 petnumber, bool statwindow)
|
|||||||
m_unit->SetUInt32Value(UNIT_FIELD_PETNUMBER, 0);
|
m_unit->SetUInt32Value(UNIT_FIELD_PETNUMBER, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharmInfo::LoadPetActionBar( std::string data )
|
void CharmInfo::LoadPetActionBar(const std::string& data )
|
||||||
{
|
{
|
||||||
InitPetActionBar();
|
InitPetActionBar();
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -931,7 +931,7 @@ struct CharmInfo
|
|||||||
//return true if successful
|
//return true if successful
|
||||||
bool AddSpellToActionBar(uint32 spellid, ActiveStates newstate = ACT_DECIDE);
|
bool AddSpellToActionBar(uint32 spellid, ActiveStates newstate = ACT_DECIDE);
|
||||||
bool RemoveSpellFromActionBar(uint32 spell_id);
|
bool RemoveSpellFromActionBar(uint32 spell_id);
|
||||||
void LoadPetActionBar(std::string data);
|
void LoadPetActionBar(const std::string& data);
|
||||||
void BuildActionBar(WorldPacket* data);
|
void BuildActionBar(WorldPacket* data);
|
||||||
void SetSpellAutocast(uint32 spell_id, bool state);
|
void SetSpellAutocast(uint32 spell_id, bool state);
|
||||||
void SetActionBar(uint8 index, uint32 spellOrAction,ActiveStates type)
|
void SetActionBar(uint8 index, uint32 spellOrAction,ActiveStates type)
|
||||||
|
|||||||
+1
-1
@@ -452,7 +452,7 @@ class World
|
|||||||
void SetAllowMovement(bool allow) { m_allowMovement = allow; }
|
void SetAllowMovement(bool allow) { m_allowMovement = allow; }
|
||||||
|
|
||||||
/// Set a new Message of the Day
|
/// 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
|
/// Get the current Message of the Day
|
||||||
const char* GetMotd() const { return m_motd.c_str(); }
|
const char* GetMotd() const { return m_motd.c_str(); }
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ struct AccountData
|
|||||||
|
|
||||||
struct AddonInfo
|
struct AddonInfo
|
||||||
{
|
{
|
||||||
AddonInfo(std::string name, uint8 enabled, uint32 crc)
|
AddonInfo(const std::string& name, uint8 enabled, uint32 crc)
|
||||||
{
|
{
|
||||||
Name = name;
|
Name = name;
|
||||||
Enabled = enabled;
|
Enabled = enabled;
|
||||||
|
|||||||
Reference in New Issue
Block a user