From 635cd0e854b3e7ec7747501e50eceb4f569d0a57 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 24 Dec 2025 15:15:06 -0700 Subject: [PATCH] [calculate-scalar] Another tiny speedup ~1% in varc-hanzi benchmark. --- src/hb-ot-var-common.hh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-var-common.hh b/src/hb-ot-var-common.hh index 9c8b5c9a3..7eba3c39d 100644 --- a/src/hb-ot-var-common.hh +++ b/src/hb-ot-var-common.hh @@ -166,10 +166,12 @@ struct TupleVariationHeader #if HB_FAST_NUM_ACCESS if (skip) { - while (i + 4 < coord_count && * (HBUINT64LE *) &peak_tuple[i] == 0) + while (i + 4 <= coord_count && * (HBUINT64LE *) &peak_tuple[i] == 0) i += 4; - while (i + 1 < coord_count && peak_tuple[i].to_int () == 0) + while (i < coord_count && peak_tuple[i].to_int () == 0) i += 1; + if (i >= coord_count) + break; } #endif #endif