summaryrefslogtreecommitdiff
path: root/src/libutp/utp_internal.cpp
diff options
context:
space:
mode:
authorHanjie Wu <wu@x-nagi.com>2023-12-16 01:31:47 -0800
committerHanjie Wu <wu@x-nagi.com>2023-12-16 01:31:47 -0800
commit25f9426b6e45e4bd2cdee8d872dab3ff0f9d7417 (patch)
tree5983e0d97af62b7fb3f4f41895bda3ef9bd6ca11 /src/libutp/utp_internal.cpp
parent58054f460e6bb04d6fd28a881c0b010df778bf5d (diff)
fix C++11 compatibility issues
Diffstat (limited to 'src/libutp/utp_internal.cpp')
-rw-r--r--src/libutp/utp_internal.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libutp/utp_internal.cpp b/src/libutp/utp_internal.cpp
index f2389395..93117e97 100644
--- a/src/libutp/utp_internal.cpp
+++ b/src/libutp/utp_internal.cpp
@@ -2808,15 +2808,18 @@ int utp_connect(utp_socket *conn, const struct sockaddr *to, socklen_t tolen)
// we have to check every case
UTPSocket* LookupAdjacent(utp_context *ctx, PackedSockAddr const& addr, uint32 const id) {
auto key = UTPSocketKey{ addr, id };
- if (auto* conn = ctx->utp_sockets.lookup(key); conn != nullptr)
+ auto* conn = ctx->utp_sockets.lookup(key);
+ if (conn != nullptr)
return conn;
key.recv_id = id + 1;
- if (auto* conn = ctx->utp_sockets.lookup(key); conn != nullptr && conn->conn_id_send == id)
+ conn = ctx->utp_sockets.lookup(key);
+ if (conn != nullptr && conn->conn_id_send == id)
return conn;
key.recv_id = id - 1;
- if (auto* conn = ctx->utp_sockets.lookup(key); conn != nullptr && conn->conn_id_send == id)
+ conn = ctx->utp_sockets.lookup(key);
+ if (conn != nullptr && conn->conn_id_send == id)
return conn;
return nullptr;