From 17aa6c8de96e4997e8cd70021b7034e709b5f459 Mon Sep 17 00:00:00 2001 From: mrtnvgr Date: Wed, 28 Jan 2026 10:26:05 +0700 Subject: [PATCH] chore(SleepActivity): use switch-case statement --- src/activities/boot_sleep/SleepActivity.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/activities/boot_sleep/SleepActivity.cpp b/src/activities/boot_sleep/SleepActivity.cpp index aace2095..cc276edb 100644 --- a/src/activities/boot_sleep/SleepActivity.cpp +++ b/src/activities/boot_sleep/SleepActivity.cpp @@ -16,19 +16,16 @@ void SleepActivity::onEnter() { Activity::onEnter(); renderPopup("Entering Sleep..."); - if (SETTINGS.sleepScreen == CrossPointSettings::SLEEP_SCREEN_MODE::BLANK) { - return renderBlankSleepScreen(); + switch (SETTINGS.sleepScreen) { + case (CrossPointSettings::SLEEP_SCREEN_MODE::BLANK): + return renderBlankSleepScreen(); + case (CrossPointSettings::SLEEP_SCREEN_MODE::CUSTOM): + return renderCustomSleepScreen(); + case (CrossPointSettings::SLEEP_SCREEN_MODE::COVER): + return renderCoverSleepScreen(); + default: + return renderDefaultSleepScreen(); } - - if (SETTINGS.sleepScreen == CrossPointSettings::SLEEP_SCREEN_MODE::CUSTOM) { - return renderCustomSleepScreen(); - } - - if (SETTINGS.sleepScreen == CrossPointSettings::SLEEP_SCREEN_MODE::COVER) { - return renderCoverSleepScreen(); - } - - renderDefaultSleepScreen(); } void SleepActivity::renderPopup(const char* message) const {