From 917cbbadde13511d449343587e44858d9571550b Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Thu, 13 Feb 2025 00:11:39 -0800 Subject: [PATCH] Fixes a couple locations where is variable is copied when it could be moved --- Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp | 4 ++-- Source/Tools/pidof/pidof.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp index d929a5c165..e91ad55bb9 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp @@ -938,7 +938,7 @@ SyscallHandler::GenerateMap(const std::string_view& GuestBinaryFile, const std:: return {}; } - const auto GuestSourceFile = fextl::fmt::format("{}/{}.src", FexSrcPath, GuestBinaryFileId); + auto GuestSourceFile = fextl::fmt::format("{}/{}.src", FexSrcPath, GuestBinaryFileId); struct stat GuestSourceFileStat; @@ -1061,7 +1061,7 @@ SyscallHandler::GenerateMap(const std::string_view& GuestBinaryFile, const std:: auto rv = fextl::make_unique(); - rv->SourceFile = GuestSourceFile; + rv->SourceFile = std::move(GuestSourceFile); auto EndSymbol = [&] { if (LastSymbolOffset) { diff --git a/Source/Tools/pidof/pidof.cpp b/Source/Tools/pidof/pidof.cpp index 877f8d2610..f73194d0f9 100644 --- a/Source/Tools/pidof/pidof.cpp +++ b/Source/Tools/pidof/pidof.cpp @@ -155,7 +155,7 @@ int main(int argc, char** argv) { PIDs.emplace_back(PIDInfo { .pid = pid, .cmdline = CMDLineData.str(), - .exe_link = exe_link, + .exe_link = std::move(exe_link), .State = State, }); }