MemorySettingsInterface: Fix bool and SetValue()

This commit is contained in:
Stenzek 2023-11-21 17:04:32 +10:00
parent e10ff550d5
commit bbeae07478
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -145,7 +145,7 @@ void MemorySettingsInterface::SetDoubleValue(const char* section, const char* ke
void MemorySettingsInterface::SetBoolValue(const char* section, const char* key, bool value)
{
SetValue(section, key, std::to_string(value));
SetValue(section, key, value ? "true" : "false");
}
void MemorySettingsInterface::SetStringValue(const char* section, const char* key, const char* value)
@ -181,7 +181,7 @@ void MemorySettingsInterface::SetValue(const char* section, const char* key, std
sit = m_sections.emplace(std::make_pair(std::string(section), KeyMap())).first;
const auto range = sit->second.equal_range(key);
if (range.first == sit->second.end())
if (range.first == range.second)
{
sit->second.emplace(std::string(key), std::move(value));
return;