From 1bbfde62d12f8b1557c6a9082bc4d4f35b7973c9 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 29 Dec 2020 19:09:54 -0500 Subject: [PATCH] SysConf: std::move name in Entry constructor Allows code to move into the constructor, avoiding copies entirely. --- Source/Core/Core/SysConf.cpp | 6 +++--- Source/Core/Core/SysConf.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/SysConf.cpp b/Source/Core/Core/SysConf.cpp index b4e0b2834a..1efd4a2244 100644 --- a/Source/Core/Core/SysConf.cpp +++ b/Source/Core/Core/SysConf.cpp @@ -211,14 +211,14 @@ bool SysConf::Save() const return result == IOS::HLE::FS::ResultCode::Success; } -SysConf::Entry::Entry(Type type_, const std::string& name_) : type(type_), name(name_) +SysConf::Entry::Entry(Type type_, std::string name_) : type(type_), name(std::move(name_)) { if (type != Type::SmallArray && type != Type::BigArray) bytes.resize(GetNonArrayEntrySize(type)); } -SysConf::Entry::Entry(Type type_, const std::string& name_, std::vector bytes_) - : type(type_), name(name_), bytes(std::move(bytes_)) +SysConf::Entry::Entry(Type type_, std::string name_, std::vector bytes_) + : type(type_), name(std::move(name_)), bytes(std::move(bytes_)) { } diff --git a/Source/Core/Core/SysConf.h b/Source/Core/Core/SysConf.h index 5eeeddb121..cf86a3e9c5 100644 --- a/Source/Core/Core/SysConf.h +++ b/Source/Core/Core/SysConf.h @@ -47,8 +47,8 @@ public: ByteBool = 7, }; - Entry(Type type_, const std::string& name_); - Entry(Type type_, const std::string& name_, std::vector bytes_); + Entry(Type type_, std::string name_); + Entry(Type type_, std::string name_, std::vector bytes_); // Intended for use with the non array types. template