diff options
author | Michael Lutz <michi@icosahedron.de> | 2019-04-02 21:31:33 +0200 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2019-04-09 22:45:15 +0200 |
commit | e804173595d49a537503ea08bec4663117bae047 (patch) | |
tree | aca1af9b44daefab8ded671615d87e08a3a96059 /src/network/network.cpp | |
parent | c7b9987d081ae4e0103309b18c93deecc395dec9 (diff) | |
download | openttd-e804173595d49a537503ea08bec4663117bae047.tar.xz |
Codechange: If something is a vector of strings, use a vector of strings instead of an AutoFreeSmallVector.
Diffstat (limited to 'src/network/network.cpp')
-rw-r--r-- | src/network/network.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/network.cpp b/src/network/network.cpp index be92623e4..ab3884c56 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -632,8 +632,8 @@ void NetworkAddServer(const char *b) */ void GetBindAddresses(NetworkAddressList *addresses, uint16 port) { - for (char *iter : _network_bind_list) { - addresses->emplace_back(iter, port); + for (const auto &iter : _network_bind_list) { + addresses->emplace_back(iter.c_str(), port); } /* No address, so bind to everything. */ @@ -647,10 +647,10 @@ void GetBindAddresses(NetworkAddressList *addresses, uint16 port) * by the function that generates the config file. */ void NetworkRebuildHostList() { - _network_host_list.Clear(); + _network_host_list.clear(); for (NetworkGameList *item = _network_game_list; item != NULL; item = item->next) { - if (item->manually) _network_host_list.push_back(stredup(item->address.GetAddressAsString(false))); + if (item->manually) _network_host_list.emplace_back(item->address.GetAddressAsString(false)); } } |