summaryrefslogtreecommitdiff
path: root/Source/Core/Common/SettingsHandler.cpp
diff options
context:
space:
mode:
authorLioncash <mai.iam2048@gmail.com>2023-12-11 07:53:10 -0500
committerLioncash <mai.iam2048@gmail.com>2023-12-11 07:54:43 -0500
commit88a973131cd3f865651bd4169a6e3bf6826fdecc (patch)
treecdf729205935d0c1168038be5962c307f1e51cd4 /Source/Core/Common/SettingsHandler.cpp
parent04b9f6c28d54aa2f6f202763a9414cb9f6c1348a (diff)
Common/SettingsHandler: Use std::string_view more
We don't need to enforce the use of std::string instances with AddSetting(). We can accept views and only construct one string, rather than three temporaries.
Diffstat (limited to 'Source/Core/Common/SettingsHandler.cpp')
-rw-r--r--Source/Core/Common/SettingsHandler.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/Common/SettingsHandler.cpp b/Source/Core/Common/SettingsHandler.cpp
index 81e5da5989..dd84b6967b 100644
--- a/Source/Core/Common/SettingsHandler.cpp
+++ b/Source/Core/Common/SettingsHandler.cpp
@@ -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;