summaryrefslogtreecommitdiff
path: root/Source/Core/Common/SettingsHandler.cpp
diff options
context:
space:
mode:
authorTilka <tilkax@gmail.com>2023-12-12 00:02:21 +0000
committerGitHub <noreply@github.com>2023-12-12 00:02:21 +0000
commit6699acf10cb0a68108abbfb0ef8c9f08a3d07a89 (patch)
treef6c7873027b4de8e9817ad2f82028f2fadc45ee1 /Source/Core/Common/SettingsHandler.cpp
parentf04d834e8fbe2f1c5f01dfc29691031797b0bf94 (diff)
parent88a973131cd3f865651bd4169a6e3bf6826fdecc (diff)
Merge pull request #12386 from lioncash/setting
Common/SettingsHandler: Minor convenience changes
Diffstat (limited to 'Source/Core/Common/SettingsHandler.cpp')
-rw-r--r--Source/Core/Common/SettingsHandler.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/Common/SettingsHandler.cpp b/Source/Core/Common/SettingsHandler.cpp
index c36805d4ce..dd84b6967b 100644
--- a/Source/Core/Common/SettingsHandler.cpp
+++ b/Source/Core/Common/SettingsHandler.cpp
@@ -81,7 +81,7 @@ void SettingsHandler::Decrypt()
// (see the comment in WriteLine), lines can be separated by CRLFLF.
// To handle this, we remove every CR and treat LF as the line ending.
// (We ignore empty lines.)
- decoded.erase(std::remove(decoded.begin(), decoded.end(), '\x0d'), decoded.end());
+ std::erase(decoded, '\x0d');
}
void SettingsHandler::Reset()
@@ -92,12 +92,12 @@ void SettingsHandler::Reset()
m_buffer = {};
}
-void SettingsHandler::AddSetting(const std::string& key, const std::string& value)
+void SettingsHandler::AddSetting(std::string_view key, std::string_view value)
{
- WriteLine(key + '=' + value + "\r\n");
+ WriteLine(fmt::format("{}={}\r\n", key, value));
}
-void SettingsHandler::WriteLine(const std::string& str)
+void SettingsHandler::WriteLine(std::string_view str)
{
const u32 old_position = m_position;
const u32 old_key = m_key;