From bbeae07478e7fc643199abd22d749dd727b26619 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 21 Nov 2023 17:04:32 +1000 Subject: [PATCH] MemorySettingsInterface: Fix bool and SetValue() --- src/common/memory_settings_interface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/memory_settings_interface.cpp b/src/common/memory_settings_interface.cpp index 2251a5d11..d7ff180ec 100644 --- a/src/common/memory_settings_interface.cpp +++ b/src/common/memory_settings_interface.cpp @@ -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;