Core/UICommon: Use std::move() a bit more.

This commit is contained in:
Admiral H. Curtiss 2021-11-22 03:44:33 +01:00
parent ab56f3ecbd
commit 269ae6f7e8
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
2 changed files with 9 additions and 9 deletions

View File

@ -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;
}

View File

@ -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();