Merge pull request #4407 from gudnimg/minor-opt-temp-gudni

optimisation: make `alert_automaton_mintemp` constructor `constexpr`
This commit is contained in:
3d-gussner 2023-10-06 09:05:24 +02:00 committed by GitHub
commit 23503624d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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 };