mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-14 18:19:11 +00:00
Codechange: pass large objects by reference instead of value
Especially when they get passed on directly to the next function or via a constructor into an instance variable
This commit is contained in:
@@ -115,7 +115,7 @@ private:
|
||||
|
||||
public:
|
||||
TCPConnecter() {};
|
||||
TCPConnecter(const std::string &connection_string, uint16 default_port, NetworkAddress bind_address = {}, int family = AF_UNSPEC);
|
||||
TCPConnecter(const std::string &connection_string, uint16 default_port, const NetworkAddress &bind_address = {}, int family = AF_UNSPEC);
|
||||
virtual ~TCPConnecter();
|
||||
|
||||
/**
|
||||
|
@@ -29,7 +29,7 @@ static std::vector<TCPConnecter *> _tcp_connecters;
|
||||
* @param default_port If not indicated in connection_string, what port to use.
|
||||
* @param bind_address The local bind address to use. Defaults to letting the OS find one.
|
||||
*/
|
||||
TCPConnecter::TCPConnecter(const std::string &connection_string, uint16 default_port, NetworkAddress bind_address, int family) :
|
||||
TCPConnecter::TCPConnecter(const std::string &connection_string, uint16 default_port, const NetworkAddress &bind_address, int family) :
|
||||
bind_address(bind_address),
|
||||
family(family)
|
||||
{
|
||||
|
Reference in New Issue
Block a user