SysConf: std::move name in Entry constructor
Allows code to move into the constructor, avoiding copies entirely.
This commit is contained in:
parent
05094ab51f
commit
1bbfde62d1
|
@ -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<u8> bytes_)
|
||||
: type(type_), name(name_), bytes(std::move(bytes_))
|
||||
SysConf::Entry::Entry(Type type_, std::string name_, std::vector<u8> bytes_)
|
||||
: type(type_), name(std::move(name_)), bytes(std::move(bytes_))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -47,8 +47,8 @@ public:
|
|||
ByteBool = 7,
|
||||
};
|
||||
|
||||
Entry(Type type_, const std::string& name_);
|
||||
Entry(Type type_, const std::string& name_, std::vector<u8> bytes_);
|
||||
Entry(Type type_, std::string name_);
|
||||
Entry(Type type_, std::string name_, std::vector<u8> bytes_);
|
||||
|
||||
// Intended for use with the non array types.
|
||||
template <typename T>
|
||||
|
|
Loading…
Reference in New Issue