[Performance] Change to use Pass by reference where valid. (#3163)

* [Performance] Change to use Pass by reference where valid.

* typo
This commit is contained in:
Aeadoin
2023-04-01 22:55:40 -04:00
committed by GitHub
parent 7f7ba2e6c2
commit 1ffdd4cb34
31 changed files with 66 additions and 66 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ void Adventure::RemovePlayer(std::string character_name)
}
}
bool Adventure::PlayerExists(std::string character_name)
bool Adventure::PlayerExists(const std::string& character_name)
{
auto iter = players.begin();
while(iter != players.end())
+1 -1
View File
@@ -71,7 +71,7 @@ public:
bool IsActive();
void AddPlayer(std::string character_name, bool add_client_to_instance = true);
void RemovePlayer(std::string character_name);
bool PlayerExists(std::string character_name);
bool PlayerExists(const std::string& character_name);
bool CreateInstance();
void IncrementCount();
void IncrementAssassinationCount();
+4 -4
View File
@@ -106,7 +106,7 @@ void LauncherLink::ProcessMessage(uint16 opcode, EQ::Net::Packet &p)
cur = result.begin();
end = result.end();
ZoneState zs;
for (; cur != end; cur++) {
for (; cur != end; ++cur) {
zs.port = cur->port;
zs.up = false;
zs.starts = 0;
@@ -232,7 +232,7 @@ void LauncherLink::BootDynamics(uint8 new_count) {
std::map<std::string, ZoneState>::iterator cur, end;
cur = m_states.begin();
end = m_states.end();
for (; cur != end; cur++) {
for (; cur != end; ++cur) {
StopZone(cur->first.c_str());
}
}
@@ -244,7 +244,7 @@ void LauncherLink::BootDynamics(uint8 new_count) {
std::map<std::string, ZoneState>::iterator cur, end;
cur = m_states.begin();
end = m_states.end();
for (; cur != end; cur++) {
for (; cur != end; ++cur) {
if (cur->first.find("dynamic_") == 0) {
if (found >= new_count) {
//this zone exceeds the number of allowed booted zones.
@@ -266,7 +266,7 @@ void LauncherLink::GetZoneList(std::vector<std::string> &l) {
std::map<std::string, ZoneState>::iterator cur, end;
cur = m_states.begin();
end = m_states.end();
for (; cur != end; cur++) {
for (; cur != end; ++cur) {
l.push_back(cur->first.c_str());
}
}
+2 -2
View File
@@ -59,8 +59,8 @@ public:
static void LockWorld() { if (_world_config) _world_config->Locked=true; }
static void UnlockWorld() { if (_world_config) _world_config->Locked=false; }
static void SetWorldAddress(std::string addr) { if (_world_config) _world_config->WorldAddress=addr; }
static void SetLocalAddress(std::string addr) { if (_world_config) _world_config->LocalAddress=addr; }
static void SetWorldAddress(const std::string& addr) { if (_world_config) _world_config->WorldAddress=addr; }
static void SetLocalAddress(const std::string& addr) { if (_world_config) _world_config->LocalAddress=addr; }
void Dump() const;
};