summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2018-09-25 22:01:05 +0100
committerPeterN <peter@fuzzle.org>2019-03-26 20:15:57 +0000
commitca2f33c6d025c0c45fb4bc472493290445312de5 (patch)
treecf39f3f0a815778049c037d80f0b86a11f1af665 /src/network
parent097328c3d73520834b4ef801945c4f57f9eca0cd (diff)
downloadopenttd-ca2f33c6d025c0c45fb4bc472493290445312de5.tar.xz
Codechange: Replaced SmallVector::Erase() with std::vector::erase()
Diffstat (limited to 'src/network')
-rw-r--r--src/network/core/tcp_connect.cpp8
-rw-r--r--src/network/core/tcp_http.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/network/core/tcp_connect.cpp b/src/network/core/tcp_connect.cpp
index 95f9662cd..470d97e68 100644
--- a/src/network/core/tcp_connect.cpp
+++ b/src/network/core/tcp_connect.cpp
@@ -66,22 +66,22 @@ void TCPConnecter::Connect()
*/
/* static */ void TCPConnecter::CheckCallbacks()
{
- for (TCPConnecter **iter = _tcp_connecters.Begin(); iter < _tcp_connecters.End(); /* nothing */) {
+ for (auto iter = _tcp_connecters.begin(); iter < _tcp_connecters.end(); /* nothing */) {
TCPConnecter *cur = *iter;
if ((cur->connected || cur->aborted) && cur->killed) {
- _tcp_connecters.Erase(iter);
+ iter = _tcp_connecters.erase(iter);
if (cur->sock != INVALID_SOCKET) closesocket(cur->sock);
delete cur;
continue;
}
if (cur->connected) {
- _tcp_connecters.Erase(iter);
+ iter = _tcp_connecters.erase(iter);
cur->OnConnect(cur->sock);
delete cur;
continue;
}
if (cur->aborted) {
- _tcp_connecters.Erase(iter);
+ iter = _tcp_connecters.erase(iter);
cur->OnFailure();
delete cur;
continue;
diff --git a/src/network/core/tcp_http.cpp b/src/network/core/tcp_http.cpp
index d2ab0638c..2d3e89b4e 100644
--- a/src/network/core/tcp_http.cpp
+++ b/src/network/core/tcp_http.cpp
@@ -311,7 +311,7 @@ int NetworkHTTPSocketHandler::Receive()
int n = select(FD_SETSIZE, &read_fd, NULL, NULL, &tv);
if (n == -1) return;
- for (NetworkHTTPSocketHandler **iter = _http_connections.Begin(); iter < _http_connections.End(); /* nothing */) {
+ for (auto iter = _http_connections.begin(); iter < _http_connections.end(); /* nothing */) {
NetworkHTTPSocketHandler *cur = *iter;
if (FD_ISSET(cur->sock, &read_fd)) {
@@ -321,7 +321,7 @@ int NetworkHTTPSocketHandler::Receive()
if (ret <= 0) {
/* Then... the connection can be closed */
cur->CloseConnection();
- _http_connections.Erase(iter);
+ iter = _http_connections.erase(iter);
delete cur;
continue;
}