From 2feac50b40f1dff06655c8efcadcc55088b34dad Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 31 Jul 2023 19:53:06 -0600 Subject: [PATCH] Revert "[gsubgpos] Keep another digest in the applicable_t" This reverts commit fd79c7cecdf68fe4626943f29bd5edf1e603d2b2. --- src/hb-ot-layout-gsubgpos.hh | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index bfd6963a2..f46fb4e03 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -1002,7 +1002,6 @@ struct hb_accelerate_subtables_context_t : hb_cache_func_t cache_func; #endif hb_set_digest_t digest; - hb_set_digest_t digest_rest; }; #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE @@ -4340,12 +4339,6 @@ struct hb_ot_layout_lookup_accelerator_t thiz->digest.init (); for (auto& subtable : hb_iter (thiz->subtables, count)) thiz->digest.add (subtable.digest); - if (count) - for (unsigned int i = count - 1; i; i--) - { - thiz->subtables[i - 1].digest_rest.add (thiz->subtables[i].digest); - thiz->subtables[i - 1].digest_rest.add (thiz->subtables[i].digest_rest); - } #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE thiz->cache_user_idx = c_accelerate_subtables.cache_user_idx; @@ -4365,28 +4358,23 @@ struct hb_ot_layout_lookup_accelerator_t #endif bool apply (hb_ot_apply_context_t *c, unsigned subtables_count, bool use_cache) const { - hb_codepoint_t g = c->buffer->cur().codepoint; #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE if (use_cache) { - for (const auto &subtable : hb_iter (subtables, subtables_count)) - { - if (subtable.apply_cached (c)) - return true; - if (!subtable.digest_rest.may_have (g)) - return false; - } + return + + hb_iter (hb_iter (subtables, subtables_count)) + | hb_map ([&c] (const hb_accelerate_subtables_context_t::hb_applicable_t &_) { return _.apply_cached (c); }) + | hb_any + ; } else #endif { - for (const auto &subtable : hb_iter (subtables, subtables_count)) - { - if (subtable.apply (c)) - return true; - if (!subtable.digest_rest.may_have (g)) - return false; - } + return + + hb_iter (hb_iter (subtables, subtables_count)) + | hb_map ([&c] (const hb_accelerate_subtables_context_t::hb_applicable_t &_) { return _.apply (c); }) + | hb_any + ; } return false; }