mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-13 00:58:29 +02:00
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.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user