summaryrefslogtreecommitdiff
path: root/Source/Core/Common/IniFile.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2017-03-22 18:19:53 -0400
committerLioncash <mathew1800@gmail.com>2017-03-22 18:47:19 -0400
commit46d74a7760e58ec36d59ab525ced11d884bcb267 (patch)
treec44aa5541d793eeaf1b28fdc0c58b58acae069e0 /Source/Core/Common/IniFile.cpp
parent99adc7338360eb5723b3325e5829b417e4d3cf08 (diff)
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.
Diffstat (limited to 'Source/Core/Common/IniFile.cpp')
-rw-r--r--Source/Core/Common/IniFile.cpp6
1 files changed, 6 insertions, 0 deletions
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);