[set] Add a brute-force intersects(other_set)

This commit is contained in:
Behdad Esfahbod 2025-02-04 19:16:57 +00:00
parent 80bbb0b2e9
commit 95eefa38f6

View file

@ -120,6 +120,13 @@ struct hb_sparseset_t
hb_sparseset_t& operator << (const hb_codepoint_pair_t& range)
{ add_range (range.first, range.second); return *this; }
bool intersects (const hb_set_t &other) const
{
hb_sparseset_t tmp = *this;
tmp.intersect (other);
return !tmp.is_empty ();
}
bool intersects (hb_codepoint_t first, hb_codepoint_t last) const
{ return s.intersects (first, last); }