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.
This commit is contained in:
@ -120,8 +120,8 @@ ResultCode ServerSession::HandleSyncRequest(std::shared_ptr<Thread> thread) {
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
std::tuple<std::shared_ptr<ServerSession>, std::shared_ptr<ClientSession>>
|
||||
KernelSystem::CreateSessionPair(const std::string& name, std::shared_ptr<ClientPort> port) {
|
||||
KernelSystem::SessionPair KernelSystem::CreateSessionPair(const std::string& name,
|
||||
std::shared_ptr<ClientPort> port) {
|
||||
auto server_session = ServerSession::Create(*this, name + "_Server").Unwrap();
|
||||
auto client_session{std::make_shared<ClientSession>(*this)};
|
||||
client_session->name = name + "_Client";
|
||||
@ -134,7 +134,7 @@ KernelSystem::CreateSessionPair(const std::string& name, std::shared_ptr<ClientP
|
||||
client_session->parent = parent;
|
||||
server_session->parent = parent;
|
||||
|
||||
return std::make_tuple(std::move(server_session), std::move(client_session));
|
||||
return std::make_pair(std::move(server_session), std::move(client_session));
|
||||
}
|
||||
|
||||
} // namespace Kernel
|
||||
|
Reference in New Issue
Block a user