From 42681bdb55a75520d4ac194302fe936d1ce3cb34 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 23 Nov 2022 21:36:43 -0700 Subject: [PATCH] [gsubgpos] No logic-change minor rewrite --- src/hb-ot-layout-gsubgpos.hh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index a61c84bed..4ef03350b 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -537,7 +537,8 @@ struct hb_ot_apply_context_t : assert (num_items > 0); /* The alternate condition below is faster at string boundaries, * but produces subpar "unsafe-to-concat" values. */ - while (idx + 1/*num_items*/ < end) + unsigned stop = end - 1/*num_items*/; + while (idx < stop) { idx++; hb_glyph_info_t &info = c->buffer->info[idx]; @@ -572,7 +573,8 @@ struct hb_ot_apply_context_t : assert (num_items > 0); /* The alternate condition below is faster at string boundaries, * but produces subpar "unsafe-to-concat" values. */ - while (idx > 0/*num_items - 1*/) + unsigned stop = 1 - 1/*num_items*/; + while (idx > stop) { idx--; hb_glyph_info_t &info = c->buffer->out_info[idx];