From 5259ab75668bea56e58a98a2a3c9c9b175281477 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 6 Jun 2020 11:24:32 -0400 Subject: [PATCH] fs/file: Make use of std::move where applicable Avoids unnecessary atomic reference count increments and decrements. --- src/core/hle/service/fs/file.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/hle/service/fs/file.cpp b/src/core/hle/service/fs/file.cpp index 3d9eee5949..75d1bb50f3 100644 --- a/src/core/hle/service/fs/file.cpp +++ b/src/core/hle/service/fs/file.cpp @@ -219,7 +219,7 @@ void File::OpenLinkFile(Kernel::HLERequestContext& ctx) { auto [server, client] = kernel.CreateSessionPair(GetName()); ClientConnected(server); - FileSessionSlot* slot = GetSessionData(server); + FileSessionSlot* slot = GetSessionData(std::move(server)); const FileSessionSlot* original_file = GetSessionData(ctx.Session()); slot->priority = original_file->priority; @@ -265,7 +265,7 @@ void File::OpenSubFile(Kernel::HLERequestContext& ctx) { auto [server, client] = kernel.CreateSessionPair(GetName()); ClientConnected(server); - FileSessionSlot* slot = GetSessionData(server); + FileSessionSlot* slot = GetSessionData(std::move(server)); slot->priority = original_file->priority; slot->offset = offset; slot->size = size; @@ -279,7 +279,7 @@ std::shared_ptr File::Connect() { auto [server, client] = kernel.CreateSessionPair(GetName()); ClientConnected(server); - FileSessionSlot* slot = GetSessionData(server); + FileSessionSlot* slot = GetSessionData(std::move(server)); slot->priority = 0; slot->offset = 0; slot->size = backend->GetSize(); @@ -289,13 +289,13 @@ std::shared_ptr File::Connect() { } std::size_t File::GetSessionFileOffset(std::shared_ptr session) { - const FileSessionSlot* slot = GetSessionData(session); + const FileSessionSlot* slot = GetSessionData(std::move(session)); ASSERT(slot); return slot->offset; } std::size_t File::GetSessionFileSize(std::shared_ptr session) { - const FileSessionSlot* slot = GetSessionData(session); + const FileSessionSlot* slot = GetSessionData(std::move(session)); ASSERT(slot); return slot->size; }