summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/ServerHandleImpl.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2020-05-15 00:15:35 +0200
committerGitHub <noreply@github.com>2020-05-15 00:15:35 +0200
commit13144a08e496b89b34093ffd3d810d3442df3c44 (patch)
tree406d79e17b69560564fdb0972a3c50542a3a96c6 /src/OSSupport/ServerHandleImpl.cpp
parentGenerate "LuaState_Typedefs.inc" before running clang-tidy (diff)
downloadcuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar
cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar.gz
cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar.bz2
cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar.lz
cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar.xz
cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.tar.zst
cuberite-13144a08e496b89b34093ffd3d810d3442df3c44.zip
Diffstat (limited to 'src/OSSupport/ServerHandleImpl.cpp')
-rw-r--r--src/OSSupport/ServerHandleImpl.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/OSSupport/ServerHandleImpl.cpp b/src/OSSupport/ServerHandleImpl.cpp
index 371125227..fb5e16216 100644
--- a/src/OSSupport/ServerHandleImpl.cpp
+++ b/src/OSSupport/ServerHandleImpl.cpp
@@ -32,7 +32,7 @@ static bool IsValidSocket(evutil_socket_t a_Socket)
// cServerHandleImpl:
cServerHandleImpl::cServerHandleImpl(cNetwork::cListenCallbacksPtr a_ListenCallbacks):
- m_ListenCallbacks(a_ListenCallbacks),
+ m_ListenCallbacks(std::move(a_ListenCallbacks)),
m_ConnListener(nullptr),
m_SecondaryConnListener(nullptr),
m_IsListening(false),
@@ -79,7 +79,7 @@ void cServerHandleImpl::Close(void)
cCSLock Lock(m_CS);
std::swap(Conns, m_Connections);
}
- for (auto conn: Conns)
+ for (const auto & conn: Conns)
{
conn->Shutdown();
}
@@ -100,7 +100,7 @@ cServerHandleImplPtr cServerHandleImpl::Listen(
cNetwork::cListenCallbacksPtr a_ListenCallbacks
)
{
- cServerHandleImplPtr res = cServerHandleImplPtr{new cServerHandleImpl(a_ListenCallbacks)};
+ cServerHandleImplPtr res{new cServerHandleImpl(std::move(a_ListenCallbacks))};
res->m_SelfPtr = res;
if (res->Listen(a_Port))
{
@@ -108,7 +108,7 @@ cServerHandleImplPtr cServerHandleImpl::Listen(
}
else
{
- a_ListenCallbacks->OnError(res->m_ErrorCode, res->m_ErrorMsg);
+ res->m_ListenCallbacks->OnError(res->m_ErrorCode, res->m_ErrorMsg);
res->m_SelfPtr.reset();
}
return res;
@@ -363,7 +363,7 @@ cServerHandlePtr cNetwork::Listen(
cNetwork::cListenCallbacksPtr a_ListenCallbacks
)
{
- return cServerHandleImpl::Listen(a_Port, a_ListenCallbacks);
+ return cServerHandleImpl::Listen(a_Port, std::move(a_ListenCallbacks));
}