From 40cce41eaeac731334251cccaa124407e6bffccb Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 14 Feb 2019 15:14:37 -0800 Subject: [PATCH] [iter] Use in a couple more intersects() calls --- src/hb-ot-layout-gsubgpos.hh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index c89b55442..216a9fb77 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -1364,9 +1364,8 @@ struct RuleSet bool intersects (const hb_set_t *glyphs, ContextClosureLookupContext &lookup_context) const { - unsigned int num_rules = rule.len; - for (unsigned int i = 0; i < num_rules; i++) - if ((this+rule[i]).intersects (glyphs, lookup_context)) + for (auto it = hb_iter (rule); it; ++it) + if ((this+*it).intersects (glyphs, lookup_context)) return true; return false; } @@ -2014,9 +2013,8 @@ struct ChainRuleSet { bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const { - unsigned int num_rules = rule.len; - for (unsigned int i = 0; i < num_rules; i++) - if ((this+rule[i]).intersects (glyphs, lookup_context)) + for (auto it = hb_iter (rule); it; ++it) + if ((this+*it).intersects (glyphs, lookup_context)) return true; return false; }