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

This commit is contained in:
Behdad Esfahbod committed 2025-02-04 22:30:42 +00:00
1 parent 80bbb0b2e9
commit 95eefa38f6
1 file changed
+7
+7
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); }