[var] Micro-optimize

This commit is contained in:
Behdad Esfahbod committed 2025-05-20 17:09:58 -06:00
1 parent 7357f6e559
commit 7165f1171d
1 file changed
+2 -1
+2 -1
View File
@@ -146,6 +146,7 @@ struct TupleVariationHeader
if (!peak) continue;
int v = coords[i];
if (!v) { scalar = 0.0; break; }
if (v == peak) continue;
if (has_interm)
@@ -160,7 +161,7 @@ struct TupleVariationHeader
else
{ if (peak != end) scalar *= (double) (end - v) / (end - peak); }
}
else if (!v || v < hb_min (0, peak) || v > hb_max (0, peak)) { scalar = 0.0; break; }
else if (v < hb_min (0, peak) || v > hb_max (0, peak)) { scalar = 0.0; break; }
else
scalar *= (double) v / peak;
}