Use more iter pipelines

This commit is contained in:
Behdad Esfahbod 2019-01-09 21:00:13 -08:00
parent 420d8ac350
commit 934d3fa2a7
2 changed files with 23 additions and 18 deletions

View File

@ -722,10 +722,11 @@ struct PairPosFormat1
{ {
bool intersects (const hb_set_t *glyphs) const bool intersects (const hb_set_t *glyphs) const
{ {
for (auto it = hb_zip (this+coverage, pairSet); it; ++it) for (auto it = hb_zip (this+coverage, pairSet)
if (glyphs->has (it->first)) | hb_filter (*glyphs, hb_first)
if ((this+it->second).intersects (glyphs, valueFormat)) | hb_map (hb_second); it; ++it)
return true; if ((this+*it).intersects (glyphs, valueFormat))
return true;
return false; return false;
} }

View File

@ -1436,10 +1436,11 @@ struct ContextFormat1
{intersects_glyph}, {intersects_glyph},
nullptr nullptr
}; };
for (auto it = hb_zip (this+coverage, ruleSet); it; ++it) for (auto it = hb_zip (this+coverage, ruleSet)
if (glyphs->has (it->first)) | hb_filter (*glyphs, hb_first)
if ((this+it->second).intersects (glyphs, lookup_context)) | hb_map (hb_second); it; ++it)
return true; if ((this+*it).intersects (glyphs, lookup_context))
return true;
return false; return false;
} }
@ -1449,9 +1450,10 @@ struct ContextFormat1
{intersects_glyph}, {intersects_glyph},
nullptr nullptr
}; };
for (auto it = hb_zip (this+coverage, ruleSet); it; ++it) for (auto it = hb_zip (this+coverage, ruleSet)
if (c->glyphs->has (it->first)) | hb_filter (*c->glyphs, hb_first)
(this+it->second).closure (c, lookup_context); | hb_map (hb_second); it; ++it)
(this+*it).closure (c, lookup_context);
} }
void collect_glyphs (hb_collect_glyphs_context_t *c) const void collect_glyphs (hb_collect_glyphs_context_t *c) const
@ -2077,10 +2079,11 @@ struct ChainContextFormat1
{intersects_glyph}, {intersects_glyph},
{nullptr, nullptr, nullptr} {nullptr, nullptr, nullptr}
}; };
for (auto it = hb_zip (this+coverage, ruleSet); it; ++it) for (auto it = hb_zip (this+coverage, ruleSet)
if (glyphs->has (it->first)) | hb_filter (*glyphs, hb_first)
if ((this+it->second).intersects (glyphs, lookup_context)) | hb_map (hb_second); it; ++it)
return true; if ((this+*it).intersects (glyphs, lookup_context))
return true;
return false; return false;
} }
@ -2090,9 +2093,10 @@ struct ChainContextFormat1
{intersects_glyph}, {intersects_glyph},
{nullptr, nullptr, nullptr} {nullptr, nullptr, nullptr}
}; };
for (auto it = hb_zip (this+coverage, ruleSet); it; ++it) for (auto it = hb_zip (this+coverage, ruleSet)
if (c->glyphs->has (it->first)) | hb_filter (*c->glyphs, hb_first)
(this+it->second).closure (c, lookup_context); | hb_map (hb_second); it; ++it)
(this+*it).closure (c, lookup_context);
} }
void collect_glyphs (hb_collect_glyphs_context_t *c) const void collect_glyphs (hb_collect_glyphs_context_t *c) const