From 441e0c2d1ace6acf83e85e9315458ebc9a67d5d9 Mon Sep 17 00:00:00 2001 From: William JCM Date: Sun, 20 Jun 2021 23:49:30 +0200 Subject: [PATCH] SaveTool: replace a chain of ifs with a switch. --- src/SaveTool/SaveTool.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/SaveTool/SaveTool.cpp b/src/SaveTool/SaveTool.cpp index 145f273..f734659 100644 --- a/src/SaveTool/SaveTool.cpp +++ b/src/SaveTool/SaveTool.cpp @@ -353,17 +353,19 @@ void SaveTool::drawImGui() { void SaveTool::drawGui() { drawMainMenu(); - if(_uiState == UiState::Disclaimer) { - drawDisclaimer(); - } - else if(_uiState == UiState::Initialising) { - drawInitialisation(); - } - else if(_uiState == UiState::ProfileManager) { - drawProfileManager(); - } - else if(_uiState == UiState::MainManager) { - drawManager(); + switch(_uiState) { + case UiState::Disclaimer: + drawDisclaimer(); + break; + case UiState::Initialising: + drawInitialisation(); + break; + case UiState::ProfileManager: + drawProfileManager(); + break; + case UiState::MainManager: + drawManager(); + break; } if(_aboutPopup) {