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:
@ -1315,14 +1315,12 @@ ResultCode SVC::CreateSessionToPort(Handle* out_client_session, Handle client_po
|
||||
}
|
||||
|
||||
ResultCode SVC::CreateSession(Handle* server_session, Handle* client_session) {
|
||||
auto sessions = kernel.CreateSessionPair();
|
||||
auto [server, client] = kernel.CreateSessionPair();
|
||||
|
||||
std::shared_ptr<Process> current_process = kernel.GetCurrentProcess();
|
||||
|
||||
auto& server = std::get<std::shared_ptr<ServerSession>>(sessions);
|
||||
CASCADE_RESULT(*server_session, current_process->handle_table.Create(std::move(server)));
|
||||
|
||||
auto& client = std::get<std::shared_ptr<ClientSession>>(sessions);
|
||||
CASCADE_RESULT(*client_session, current_process->handle_table.Create(std::move(client)));
|
||||
|
||||
LOG_TRACE(Kernel_SVC, "called");
|
||||
|
Reference in New Issue
Block a user