From 44c585a6df139665a953c1f85e6e3adcc204e71f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 29 Nov 2022 20:51:58 -0700 Subject: [PATCH] [ClassDef] Fix disabled codeblock --- src/hb-ot-layout-common.hh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 180a54563..76870bc47 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -1969,18 +1969,20 @@ struct ClassDefFormat2_4 return; } -#if 0 /* The following implementation is faster asymptotically, but slower * in practice. */ - if ((count >> 3) > glyphs->get_population ()) + if (false && count > glyphs->get_population () * hb_bit_storage (count)) { for (hb_codepoint_t g = HB_SET_VALUE_INVALID; glyphs->next (&g);) - if (rangeRecord.as_array ().bfind (g)) + { + unsigned i; + if (rangeRecord.as_array ().bfind (g, &i) && + rangeRecord.arrayZ[i].value == klass) intersect_glyphs->add (g); + } return; } -#endif for (unsigned int i = 0; i < count; i++) {