diff --git a/r5dev/tier1/NetAdr2.cpp b/r5dev/tier1/NetAdr2.cpp index e778470a..f39fb864 100644 --- a/r5dev/tier1/NetAdr2.cpp +++ b/r5dev/tier1/NetAdr2.cpp @@ -88,7 +88,7 @@ CNetAdr2::~CNetAdr2(void) // Purpose: sets the IP address. // input : svInAdr - //----------------------------------------------------------------------------- -void CNetAdr2::SetIP(std::string svInAdr) +void CNetAdr2::SetIP(const std::string& svInAdr) { m_svip = "[" + svInAdr + "]"; } @@ -97,7 +97,7 @@ void CNetAdr2::SetIP(std::string svInAdr) // Purpose: sets the port. // input : svInPort - //----------------------------------------------------------------------------- -void CNetAdr2::SetPort(std::string svInPort) +void CNetAdr2::SetPort(const std::string& svInPort) { m_svip += ":" + svInPort; } @@ -107,7 +107,7 @@ void CNetAdr2::SetPort(std::string svInPort) // input : svInAdr - // svInPort - //----------------------------------------------------------------------------- -void CNetAdr2::SetIPAndPort(std::string svInAdr, std::string svInPort) +void CNetAdr2::SetIPAndPort(const std::string& svInAdr, const std::string& svInPort) { m_svip = "[" + svInAdr + "]:" + svInPort; SetVersion(); @@ -117,7 +117,7 @@ void CNetAdr2::SetIPAndPort(std::string svInAdr, std::string svInPort) // Purpose: sets the type. // Input : type - //----------------------------------------------------------------------------- -void CNetAdr2::SetType(netadrtype_t type) +void CNetAdr2::SetType(const netadrtype_t& type) { m_type = type; } @@ -147,7 +147,7 @@ void CNetAdr2::SetVersion(void) // Purpose: sets IP address and port from sockaddr struct. // Input : hSocket - //----------------------------------------------------------------------------- -void CNetAdr2:: SetFromSocket(int hSocket) +void CNetAdr2::SetFromSocket(const int& hSocket) { Clear(); m_type = netadrtype_t::NA_IP; diff --git a/r5dev/tier1/NetAdr2.h b/r5dev/tier1/NetAdr2.h index 10212471..02c576a2 100644 --- a/r5dev/tier1/NetAdr2.h +++ b/r5dev/tier1/NetAdr2.h @@ -48,12 +48,12 @@ public: CNetAdr2(std::string svInAdr, std::string svInPort); ~CNetAdr2(void); - void SetIP(std::string svInAdr); - void SetPort(std::string svInPort); - void SetIPAndPort(std::string svInAdr, std::string svInPort); - void SetType(netadrtype_t version); + void SetIP(const std::string& svInAdr); + void SetPort(const std::string& svInPort); + void SetIPAndPort(const std::string& svInAdr, const std::string& svInPort); + void SetType(const netadrtype_t& type); void SetVersion(void); - void SetFromSocket(int hSocket); + void SetFromSocket(const int& hSocket); bool SetFromSockadr(sockaddr_storage* s); std::string GetIP(bool bBaseOnly) const;