From 269ae6f7e8615b3110ca7389897b7f237231ffe8 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Mon, 22 Nov 2021 03:44:33 +0100 Subject: [PATCH] Core/UICommon: Use std::move() a bit more. --- Source/Core/UICommon/UICommon.cpp | 16 ++++++++-------- Source/Core/UICommon/UICommon.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/Core/UICommon/UICommon.cpp b/Source/Core/UICommon/UICommon.cpp index 8bad3e60d8..a5f0721251 100644 --- a/Source/Core/UICommon/UICommon.cpp +++ b/Source/Core/UICommon/UICommon.cpp @@ -51,10 +51,10 @@ namespace UICommon { -static void CreateDumpPath(const std::string& path) +static void CreateDumpPath(std::string path) { if (!path.empty()) - File::SetUserPath(D_DUMP_IDX, path); + File::SetUserPath(D_DUMP_IDX, std::move(path)); File::CreateFullPath(File::GetUserPath(D_DUMPAUDIO_IDX)); File::CreateFullPath(File::GetUserPath(D_DUMPDSP_IDX)); File::CreateFullPath(File::GetUserPath(D_DUMPSSL_IDX)); @@ -63,18 +63,18 @@ static void CreateDumpPath(const std::string& path) File::CreateFullPath(File::GetUserPath(D_DUMPTEXTURES_IDX)); } -static void CreateLoadPath(const std::string& path) +static void CreateLoadPath(std::string path) { if (!path.empty()) - File::SetUserPath(D_LOAD_IDX, path); + File::SetUserPath(D_LOAD_IDX, std::move(path)); File::CreateFullPath(File::GetUserPath(D_HIRESTEXTURES_IDX)); File::CreateFullPath(File::GetUserPath(D_RIIVOLUTION_IDX)); } -static void CreateResourcePackPath(const std::string& path) +static void CreateResourcePackPath(std::string path) { if (!path.empty()) - File::SetUserPath(D_RESOURCEPACK_IDX, path); + File::SetUserPath(D_RESOURCEPACK_IDX, std::move(path)); } static void CreateWFSPath(const std::string& path) @@ -212,12 +212,12 @@ void CreateDirectories() #endif } -void SetUserDirectory(const std::string& custom_path) +void SetUserDirectory(std::string custom_path) { if (!custom_path.empty()) { File::CreateFullPath(custom_path + DIR_SEP); - File::SetUserPath(D_USER_IDX, custom_path); + File::SetUserPath(D_USER_IDX, std::move(custom_path)); return; } diff --git a/Source/Core/UICommon/UICommon.h b/Source/Core/UICommon/UICommon.h index a6e5743325..ea1d44e599 100644 --- a/Source/Core/UICommon/UICommon.h +++ b/Source/Core/UICommon/UICommon.h @@ -23,7 +23,7 @@ void InhibitScreenSaver(bool enable); void SetLocale(std::string locale_name); void CreateDirectories(); -void SetUserDirectory(const std::string& custom_path); +void SetUserDirectory(std::string custom_path); bool TriggerSTMPowerEvent();