From a0ae63d030dde71f6c4d77c223e837ac039eb027 Mon Sep 17 00:00:00 2001 From: Luke Usher Date: Thu, 8 Oct 2020 09:20:54 +0100 Subject: [PATCH] settings: use if statements rather than switch/case --- src/common/Settings.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/common/Settings.cpp b/src/common/Settings.cpp index 0848db2ad..1197e13a3 100644 --- a/src/common/Settings.cpp +++ b/src/common/Settings.cpp @@ -904,25 +904,16 @@ CXBX_DATA Settings::SetupFile(std::string& file_path_out) void Settings::RemoveLegacyConfigs(unsigned int CurrentRevision) { - switch (CurrentRevision) { - case 2: - case 3: - case 4: + if (CurrentRevision == 4) { m_si.Delete(section_controller_dinput, nullptr, true); m_si.Delete(section_controller_port, nullptr, true); - break; - case 5: - m_si.Delete(section_core, "LoaderExperiment", true); - break; - case 6: - break; - case 9: - m_si.Delete(section_video, "HardwareYUV", true); - break; - default: - break; } + if (CurrentRevision == 5) { + m_si.Delete(section_core, "LoaderExperiment", true); + } + + if (CurrentRevision < 8) { const std::string kb_str = "Keyboard"; @@ -956,4 +947,8 @@ void Settings::RemoveLegacyConfigs(unsigned int CurrentRevision) } } } + + if(CurrentRevision == 9) { + m_si.Delete(section_video, "HardwareYUV", true); + } }