[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
+4 -4
View File
@@ -32,7 +32,7 @@ void ServerToClient45SayLink(std::string& clientSayLink, const std::string& serv
void ServerToClient50SayLink(std::string& clientSayLink, const std::string& serverSayLink);
void ServerToClient55SayLink(std::string& clientSayLink, const std::string& serverSayLink);
ChatChannel::ChatChannel(std::string inName, std::string inOwner, std::string inPassword, bool inPermanent, int inMinimumStatus) :
ChatChannel::ChatChannel(const std::string& inName, const std::string& inOwner, const std::string& inPassword, bool inPermanent, int inMinimumStatus) :
m_delete_timer(0) {
m_name = inName;
@@ -137,7 +137,7 @@ ChatChannel *ChatChannelList::CreateChannel(
return new_channel;
}
ChatChannel* ChatChannelList::FindChannel(std::string Name) {
ChatChannel* ChatChannelList::FindChannel(const std::string& Name) {
std::string normalized_name = CapitaliseName(Name);
@@ -283,7 +283,7 @@ void ChatChannel::SetPassword(const std::string& in_password) {
}
}
void ChatChannel::SetOwner(std::string& in_owner) {
void ChatChannel::SetOwner(const std::string& in_owner) {
m_owner = in_owner;
@@ -784,7 +784,7 @@ bool ChatChannel::HasVoice(std::string inVoiced)
return std::find(std::begin(m_voiced), std::end(m_voiced), inVoiced) != std::end(m_voiced);
}
std::string CapitaliseName(std::string inString) {
std::string CapitaliseName(const std::string& inString) {
std::string NormalisedName = inString;