aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/client_port.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-04-06 01:41:43 -0400
committerLioncash <mathew1800@gmail.com>2019-04-06 01:42:03 -0400
commitbfbadb38be4f4eabf0e6745a64cb44c35e93d347 (patch)
treea599221fe5fea442ca6e488f2fae7b0eab4d0c2d /src/core/hle/kernel/client_port.cpp
parent05243b30415f09d5ead3a16bfc49e0571943fa5b (diff)
kernel/server_session: Return a std::pair from CreateSessionPair()
Keeps the return type consistent with the function name. While we're at it, we can also reduce the amount of boilerplate involved with handling these by using structured bindings.
Diffstat (limited to 'src/core/hle/kernel/client_port.cpp')
-rw-r--r--src/core/hle/kernel/client_port.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/core/hle/kernel/client_port.cpp b/src/core/hle/kernel/client_port.cpp
index aa432658e8..744b1697dd 100644
--- a/src/core/hle/kernel/client_port.cpp
+++ b/src/core/hle/kernel/client_port.cpp
@@ -2,8 +2,6 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
-#include <tuple>
-
#include "core/hle/kernel/client_port.h"
#include "core/hle/kernel/client_session.h"
#include "core/hle/kernel/errors.h"
@@ -31,18 +29,18 @@ ResultVal<SharedPtr<ClientSession>> ClientPort::Connect() {
active_sessions++;
// Create a new session pair, let the created sessions inherit the parent port's HLE handler.
- auto sessions = ServerSession::CreateSessionPair(kernel, server_port->GetName(), this);
+ auto [server, client] = ServerSession::CreateSessionPair(kernel, server_port->GetName(), this);
if (server_port->HasHLEHandler()) {
- server_port->GetHLEHandler()->ClientConnected(std::get<SharedPtr<ServerSession>>(sessions));
+ server_port->GetHLEHandler()->ClientConnected(server);
} else {
- server_port->AppendPendingSession(std::get<SharedPtr<ServerSession>>(sessions));
+ server_port->AppendPendingSession(server);
}
// Wake the threads waiting on the ServerPort
server_port->WakeupAllWaitingThreads();
- return MakeResult(std::get<SharedPtr<ClientSession>>(sessions));
+ return MakeResult(client);
}
void ClientPort::ConnectionClosed() {