From 95eefa38f6e14da4e1e2e4412fe0fe0107b93bf7 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 4 Feb 2025 19:16:57 +0000 Subject: [PATCH] [set] Add a brute-force intersects(other_set) --- src/hb-set.hh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/hb-set.hh b/src/hb-set.hh index f6013a414..e78099e34 100644 --- a/src/hb-set.hh +++ b/src/hb-set.hh @@ -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); }