[bit-set-invertible] Fix last remaining corner-case

This commit is contained in:
Behdad Esfahbod 2021-08-19 15:18:32 -06:00
parent e8911d137c
commit 1babe80ed2
1 changed files with 12 additions and 1 deletions

View File

@ -119,7 +119,18 @@ struct hb_bit_set_invertible_t
void set (const hb_bit_set_invertible_t &other) { s.set (other.s); inverted = other.inverted; }
bool is_equal (const hb_bit_set_invertible_t &other) const
{ return inverted == other.inverted /*XXX*/ && s.is_equal (other.s); }
{
if (likely (inverted == other.inverted))
return s.is_equal (other.s);
else
{
/* TODO Add iter_ranges() and use here. */
auto it1 = iter ();
auto it2 = other.iter ();
return hb_all (+ hb_zip (it1, it2)
| hb_map ([](hb_pair_t<hb_codepoint_t, hb_codepoint_t> _) { return _.first == _.second; }));
}
}
bool is_subset (const hb_bit_set_invertible_t &larger_set) const
{