From 46d74a7760e58ec36d59ab525ced11d884bcb267 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 22 Mar 2017 18:19:53 -0400 Subject: 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. --- Source/Core/Common/IniFile.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Source/Core/Common/IniFile.cpp') diff --git a/Source/Core/Common/IniFile.cpp b/Source/Core/Common/IniFile.cpp index 50752aabc1..cf2c89e0f3 100644 --- a/Source/Core/Common/IniFile.cpp +++ b/Source/Core/Common/IniFile.cpp @@ -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); -- cgit v1.2.3