From f4cfd6b6adbe0a87fe565a29b6cd600cf86f65dd Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 14 Feb 2019 13:45:52 -0800 Subject: [PATCH] [iter] A couple more hb_apply() + lambda uses --- src/hb-ot-layout-gsub-table.hh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 223c0f292..9b672bafe 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -842,18 +842,20 @@ struct LigatureSubstFormat1 void closure (hb_closure_context_t *c) const { - for (auto it = hb_zip (this+coverage, ligatureSet) - | hb_filter (*c->glyphs, hb_first) - | hb_map (hb_second); it; ++it) - (this+*it).closure (c); + + hb_zip (this+coverage, ligatureSet) + | hb_filter (*c->glyphs, hb_first) + | hb_map (hb_second) + | hb_apply ([&](const OffsetTo &_) { (this+_).closure (c); }) + ; } void collect_glyphs (hb_collect_glyphs_context_t *c) const { if (unlikely (!(this+coverage).add_coverage (c->input))) return; - for (auto it = hb_zip (this+coverage, ligatureSet) - | hb_map (hb_second); it; ++it) - (this+*it).collect_glyphs (c); + + hb_zip (this+coverage, ligatureSet) + | hb_map (hb_second) + | hb_apply ([&](const OffsetTo &_) { (this+_).collect_glyphs (c); }) + ; } const Coverage &get_coverage () const { return this+coverage; }