From b2daf2587f35b28696cb29502bc42e69ea1ff843 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Thu, 19 Feb 2026 02:59:38 +0300 Subject: [PATCH] Minor parameters code simplifications readOnly is false by default INFINITY == INFINITY, so remove redundant check --- flix/parameters.ino | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flix/parameters.ino b/flix/parameters.ino index 3a0e501..83ecbbb 100644 --- a/flix/parameters.ino +++ b/flix/parameters.ino @@ -113,7 +113,7 @@ Parameter parameters[] = { void setupParameters() { print("Setup parameters\n"); - storage.begin("flix", false); + storage.begin("flix"); // Read parameters from storage for (auto ¶meter : parameters) { if (!storage.isKey(parameter.name)) { @@ -165,8 +165,7 @@ void syncParameters() { for (auto ¶meter : parameters) { if (parameter.getValue() == parameter.cache) continue; // no change - if (isnan(parameter.getValue()) && isnan(parameter.cache)) continue; // both are NaN - if (isinf(parameter.getValue()) && isinf(parameter.cache)) continue; // both are Inf + if (isnan(parameter.getValue()) && isnan(parameter.cache)) continue; // both are NAN storage.putFloat(parameter.name, parameter.getValue()); parameter.cache = parameter.getValue(); // update cache