mirror of
https://github.com/okalachev/flix.git
synced 2026-03-29 11:34:36 +00:00
Minor parameters code simplifications
readOnly is false by default INFINITY == INFINITY, so remove redundant check
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user