[iter] Fix bug in hb_any() and hb_none()

This commit is contained in:
Behdad Esfahbod 2019-03-29 23:31:07 -07:00
parent f505b5d5c9
commit e530692799
3 changed files with 9 additions and 9 deletions

View File

@ -552,7 +552,7 @@ static const struct
operator () (Iterable&& c) const
{
for (auto it = hb_iter (c); it; ++it)
if (it)
if (*it)
return true;
return false;
}
@ -566,7 +566,7 @@ static const struct
operator () (Iterable&& c) const
{
for (auto it = hb_iter (c); it; ++it)
if (it)
if (*it)
return false;
return true;
}

View File

@ -1546,9 +1546,9 @@ struct ContextFormat2
return
+ hb_enumerate (ruleSet)
| hb_filter ([&] (const hb_pair_t<unsigned, const OffsetTo<RuleSet> &> p) -> bool
{ return class_def.intersects_class (glyphs, p.first) &&
(this+p.second).intersects (glyphs, lookup_context); })
| hb_map ([&] (const hb_pair_t<unsigned, const OffsetTo<RuleSet> &> p) -> bool
{ return class_def.intersects_class (glyphs, p.first) &&
(this+p.second).intersects (glyphs, lookup_context); })
| hb_any
;
}
@ -2193,9 +2193,9 @@ struct ChainContextFormat2
return
+ hb_enumerate (ruleSet)
| hb_filter ([&] (const hb_pair_t<unsigned, const OffsetTo<ChainRuleSet> &> p) -> bool
{ return input_class_def.intersects_class (glyphs, p.first) &&
(this+p.second).intersects (glyphs, lookup_context); })
| hb_map ([&] (const hb_pair_t<unsigned, const OffsetTo<ChainRuleSet> &> p) -> bool
{ return input_class_def.intersects_class (glyphs, p.first) &&
(this+p.second).intersects (glyphs, lookup_context); })
| hb_any
;
}

View File

@ -137,7 +137,7 @@ main (int argc, char **argv)
test_iterator (hb_zip (st, v));
hb_any (hb_zip (st, v));
hb_any (st);
hb_array_t<hb_vector_t<int> > pa;
pa->as_array ();