[subset] Use dagger

Better fix for https://github.com/harfbuzz/harfbuzz/pull/2858
This commit is contained in:
Behdad Esfahbod 2021-02-19 16:48:30 -07:00
parent d8ea552d10
commit 103ed7da83

View File

@ -2061,20 +2061,14 @@ struct LigatureArray : OffsetListOf<LigatureAttach>
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);