mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-28 23:38:49 +00: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:
parent
04b9f6c28d
commit
88a973131c
2 changed files with 5 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue