mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-02 22:29:21 +00:00
IniFile: Make Section's string constructor instances take strings by value
As the name is immediately stored into a class member, a move here is a better choice. This also moves the constructor implementations into the cpp file to avoid an otherwise unnecessary inclusion in the header. This is also likely a better choice as Section contains several non-trivial members, so this would avoid potentially inlining a bunch of setup and teardown code related to them as a side-benefit.
This commit is contained in:
parent
99adc73383
commit
46d74a7760
2 changed files with 8 additions and 2 deletions
|
@ -39,6 +39,12 @@ void IniFile::ParseLine(const std::string& line, std::string* keyOut, std::strin
|
|||
|
||||
const std::string& IniFile::NULL_STRING = "";
|
||||
|
||||
IniFile::Section::Section() = default;
|
||||
|
||||
IniFile::Section::Section(std::string name_) : name{std::move(name_)}
|
||||
{
|
||||
}
|
||||
|
||||
void IniFile::Section::Set(const std::string& key, const std::string& newValue)
|
||||
{
|
||||
auto it = values.find(key);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue