diff options
author | Henry Wilson <m3henry@googlemail.com> | 2018-09-23 12:23:54 +0100 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-03-26 20:15:57 +0000 |
commit | a690936ed75e96627be0e2ecafee2360a71e8d3c (patch) | |
tree | 1221c131b8fe3a51cf43a6bd7d89a51c431c559d /src/network/core | |
parent | 56ae855dc20b27593c9a454d5a09d8f892a6c71f (diff) | |
download | openttd-a690936ed75e96627be0e2ecafee2360a71e8d3c.tar.xz |
Codechange: Replace SmallVector::Length() with std::vector::size()
Diffstat (limited to 'src/network/core')
-rw-r--r-- | src/network/core/tcp_http.cpp | 2 | ||||
-rw-r--r-- | src/network/core/tcp_listen.h | 4 | ||||
-rw-r--r-- | src/network/core/udp.cpp | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/network/core/tcp_http.cpp b/src/network/core/tcp_http.cpp index 3a40e3eec..d2ab0638c 100644 --- a/src/network/core/tcp_http.cpp +++ b/src/network/core/tcp_http.cpp @@ -297,7 +297,7 @@ int NetworkHTTPSocketHandler::Receive() /* static */ void NetworkHTTPSocketHandler::HTTPReceive() { /* No connections, just bail out. */ - if (_http_connections.Length() == 0) return; + if (_http_connections.size() == 0) return; fd_set read_fd; struct timeval tv; diff --git a/src/network/core/tcp_listen.h b/src/network/core/tcp_listen.h index b9f987190..55594070b 100644 --- a/src/network/core/tcp_listen.h +++ b/src/network/core/tcp_listen.h @@ -140,7 +140,7 @@ public: */ static bool Listen(uint16 port) { - assert(sockets.Length() == 0); + assert(sockets.size() == 0); NetworkAddressList addresses; GetBindAddresses(&addresses, port); @@ -149,7 +149,7 @@ public: address->Listen(SOCK_STREAM, &sockets); } - if (sockets.Length() == 0) { + if (sockets.size() == 0) { DEBUG(net, 0, "[server] could not start network: could not create listening socket"); NetworkError(STR_NETWORK_ERROR_SERVER_START); return false; diff --git a/src/network/core/udp.cpp b/src/network/core/udp.cpp index 83c14d2b0..db655c0cf 100644 --- a/src/network/core/udp.cpp +++ b/src/network/core/udp.cpp @@ -51,7 +51,7 @@ bool NetworkUDPSocketHandler::Listen() addr->Listen(SOCK_DGRAM, &this->sockets); } - return this->sockets.Length() != 0; + return this->sockets.size() != 0; } /** @@ -80,7 +80,7 @@ NetworkRecvStatus NetworkUDPSocketHandler::CloseConnection(bool error) */ void NetworkUDPSocketHandler::SendPacket(Packet *p, NetworkAddress *recv, bool all, bool broadcast) { - if (this->sockets.Length() == 0) this->Listen(); + if (this->sockets.size() == 0) this->Listen(); for (SocketList::iterator s = this->sockets.Begin(); s != this->sockets.End(); s++) { /* Make a local copy because if we resolve it we cannot |