[iter] Use more

This commit is contained in:
Behdad Esfahbod 2019-02-14 17:10:04 -08:00
parent 72c1b59588
commit 5b99c92d4c
2 changed files with 6 additions and 8 deletions

View File

@ -367,7 +367,7 @@ static const struct
hb_enable_if (hb_is_iterable (A) && hb_is_iterable (B))> hb_enable_if (hb_is_iterable (A) && hb_is_iterable (B))>
hb_zip_iter_t<hb_iter_t (A), hb_iter_t (B)> hb_zip_iter_t<hb_iter_t (A), hb_iter_t (B)>
operator () (const A& a, const B &b) const operator () (const A& a, const B &b) const
{ return hb_zip_iter_t<hb_iter_t (A), hb_iter_t (B)> (a.iter (), b.iter ()); } { return hb_zip_iter_t<hb_iter_t (A), hb_iter_t (B)> (hb_iter (a), hb_iter (b)); }
} hb_zip HB_UNUSED; } hb_zip HB_UNUSED;
/* hb_apply() */ /* hb_apply() */
@ -451,7 +451,7 @@ template <typename C, typename V,
inline void inline void
hb_fill (C& c, const V &v) hb_fill (C& c, const V &v)
{ {
for (auto i = c.iter (); i; i++) for (auto i = hb_iter (c); i; i++)
hb_assign (*i, v); hb_assign (*i, v);
} }

View File

@ -1572,9 +1572,8 @@ struct ContextFormat2
&class_def &class_def
}; };
unsigned int count = ruleSet.len; for (auto it = hb_iter (ruleSet); it; ++it)
for (unsigned int i = 0; i < count; i++) (this+*it).collect_glyphs (c, lookup_context);
(this+ruleSet[i]).collect_glyphs (c, lookup_context);
} }
bool would_apply (hb_would_apply_context_t *c) const bool would_apply (hb_would_apply_context_t *c) const
@ -2219,9 +2218,8 @@ struct ChainContextFormat2
&lookahead_class_def} &lookahead_class_def}
}; };
unsigned int count = ruleSet.len; for (auto it = hb_iter (ruleSet); it; ++it)
for (unsigned int i = 0; i < count; i++) (this+*it).collect_glyphs (c, lookup_context);
(this+ruleSet[i]).collect_glyphs (c, lookup_context);
} }
bool would_apply (hb_would_apply_context_t *c) const bool would_apply (hb_would_apply_context_t *c) const