[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
@@ -2,7 +2,7 @@
#include "../common/eqemu_logsys.h"
#include "../common/strings.h"
void CombatRecord::Start(std::string in_mob_name)
void CombatRecord::Start(const std::string& in_mob_name)
{
m_start_time = std::time(nullptr);
m_end_time = 0;
+1 -1
View File
@@ -7,7 +7,7 @@
class CombatRecord {
public:
void Start(std::string in_mob_name);
void Start(const std::string& in_mob_name);
void Stop();
bool InCombat() const;
void ProcessHPEvent(int64 hp, int64 current_hp);
+3 -3
View File
@@ -98,7 +98,7 @@ void Embperl::DoInit() {
try {
init_eval_file();
}
catch(std::string e)
catch(std::string& e)
{
//remember... lasterr() is no good if we crap out here, in construction
LogQuests("Perl Error [{}]", e);
@@ -138,7 +138,7 @@ void Embperl::DoInit() {
perl_command = "main::eval_file('plugin', '" + Config->PluginPlFile + "');";
eval_pv(perl_command.c_str(), FALSE);
}
catch(std::string e)
catch(std::string& e)
{
LogQuests("Warning [{}]: [{}]", Config->PluginPlFile, e);
}
@@ -156,7 +156,7 @@ void Embperl::DoInit() {
"}";
eval_pv(perl_command.c_str(),FALSE);
}
catch(std::string e)
catch(std::string& e)
{
LogQuests("Warning [{}]", e);
}
+1 -1
View File
@@ -147,7 +147,7 @@ public:
void AddRaidLooter(const char* looter);
void RemoveRaidLooter(const char* looter);
inline void SetRaidMOTD(std::string in_motd) { motd = in_motd; };
inline void SetRaidMOTD(const std::string& in_motd) { motd = in_motd; };
//util func
//keeps me from having to keep iterating through the list