From 103ed7da83758e6327a0b0b3e8f521dd41f2232b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 19 Feb 2021 16:48:30 -0700 Subject: [PATCH] [subset] Use dagger Better fix for https://github.com/harfbuzz/harfbuzz/pull/2858 --- src/hb-ot-layout-gpos-table.hh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 738b0c8ec..f523e35c0 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -2061,20 +2061,14 @@ struct LigatureArray : OffsetListOf auto *out = c->serializer->start_embed (this); if (unlikely (!c->serializer->extend_min (out))) return_trace (false); - unsigned ligature_count = 0; - for (hb_codepoint_t gid : coverage) + for (const auto _ : + hb_zip (coverage, *this) + | hb_filter (glyphset, hb_first)) { - if (ligature_count >= this->len) - break; - - ligature_count++; - if (!glyphset.has (gid)) continue; - auto *matrix = out->serialize_append (c->serializer); if (unlikely (!matrix)) return_trace (false); matrix->serialize_subset (c, - this->arrayZ[ligature_count - 1], + _.second, this, class_count, klass_mapping);