From ae494b04de7ebf8dece6fddc08d45f4dcc727f54 Mon Sep 17 00:00:00 2001 From: gudnimg Date: Sun, 24 Sep 2023 11:41:18 +0000 Subject: [PATCH] optimisation: make constructor constexpr Minor optimisation I found. It doesn't save much but this change should be harmless :) Change in memory: Flash: -30 bytes SRAM: 0 bytes --- Firmware/temperature.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index d02a900a6..b932e0dd5 100755 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -1393,7 +1393,8 @@ void check_max_temp_raw() //! used to slow down text switching struct alert_automaton_mintemp { const char *m2; - alert_automaton_mintemp(const char *m2):m2(m2){} + inline constexpr alert_automaton_mintemp(const char *m2) + : m2(m2) {} private: enum { ALERT_AUTOMATON_SPEED_DIV = 5 }; enum class States : uint8_t { Init = 0, TempAboveMintemp, ShowPleaseRestart, ShowMintemp };