From 896b31670d07cbe276feff1db249b64faa5c552c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 29 Mar 2019 21:16:30 -0700 Subject: [PATCH] [iter] Port two more loops to dagger --- src/hb-ot-layout-gsub-table.hh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 8aa2eb65..c26fb971 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -46,16 +46,20 @@ struct SingleSubstFormat1 void closure (hb_closure_context_t *c) const { - for (auto it = hb_iter (this+coverage) - | hb_filter (*c->glyphs); it; ++it) - c->output->add ((*it + deltaGlyphID) & 0xFFFFu); + + hb_iter (this+coverage) + | hb_filter (*c->glyphs) + | hb_map ([&] (hb_codepoint_t g) -> hb_codepoint_t { return (g + deltaGlyphID) & 0xFFFFu; }) + | hb_sink (c->output) + ; } void collect_glyphs (hb_collect_glyphs_context_t *c) const { if (unlikely (!(this+coverage).add_coverage (c->input))) return; - for (auto it = hb_iter (this+coverage); it; ++it) - c->output->add ((*it + deltaGlyphID) & 0xFFFFu); + + hb_iter (this+coverage) + | hb_map ([&] (hb_codepoint_t g) -> hb_codepoint_t { return (g + deltaGlyphID) & 0xFFFFu; }) + | hb_sink (c->output) + ; } const Coverage &get_coverage () const { return this+coverage; } -- GitLab