From 7165f1171d6cf9369db9fdfe5eabc59b7ccd5df7 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 20 May 2025 17:09:58 -0600 Subject: [PATCH] [var] Micro-optimize --- src/hb-ot-var-common.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-var-common.hh b/src/hb-ot-var-common.hh index ee5f25232..a2d34567b 100644 --- a/src/hb-ot-var-common.hh +++ b/src/hb-ot-var-common.hh @@ -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; }