[iter] Port two more loops to dagger

This commit is contained in:
Behdad Esfahbod 2019-03-29 21:16:30 -07:00
parent 8e34cb251a
commit 896b31670d
1 changed files with 9 additions and 5 deletions

View File

@ -46,16 +46,20 @@ struct SingleSubstFormat1
void closure (hb_closure_context_t *c) const void closure (hb_closure_context_t *c) const
{ {
for (auto it = hb_iter (this+coverage) + hb_iter (this+coverage)
| hb_filter (*c->glyphs); it; ++it) | hb_filter (*c->glyphs)
c->output->add ((*it + deltaGlyphID) & 0xFFFFu); | 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 void collect_glyphs (hb_collect_glyphs_context_t *c) const
{ {
if (unlikely (!(this+coverage).add_coverage (c->input))) return; if (unlikely (!(this+coverage).add_coverage (c->input))) return;
for (auto it = hb_iter (this+coverage); it; ++it) + hb_iter (this+coverage)
c->output->add ((*it + deltaGlyphID) & 0xFFFFu); | 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; } const Coverage &get_coverage () const { return this+coverage; }