From c05002afb8ff7ecb5d862278db32890aaf423c65 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 5 Feb 2025 16:46:13 +0000 Subject: [PATCH] [set] Add may_have() as alias for get() --- src/hb-bit-page.hh | 1 + src/hb-bit-set-invertible.hh | 1 + src/hb-bit-set.hh | 1 + src/hb-set.hh | 1 + 4 files changed, 4 insertions(+) diff --git a/src/hb-bit-page.hh b/src/hb-bit-page.hh index 101e9d067..a0e1d6ac0 100644 --- a/src/hb-bit-page.hh +++ b/src/hb-bit-page.hh @@ -117,6 +117,7 @@ struct hb_bit_page_t void del (hb_codepoint_t g) { elt (g) &= ~mask (g); dirty (); } void set (hb_codepoint_t g, bool value) { if (value) add (g); else del (g); } bool get (hb_codepoint_t g) const { return elt (g) & mask (g); } + bool may_have (hb_codepoint_t g) const { return get (g); } bool operator [] (hb_codepoint_t g) const { return get (g); } bool operator () (hb_codepoint_t g) const { return get (g); } diff --git a/src/hb-bit-set-invertible.hh b/src/hb-bit-set-invertible.hh index bc8a545ad..034772344 100644 --- a/src/hb-bit-set-invertible.hh +++ b/src/hb-bit-set-invertible.hh @@ -126,6 +126,7 @@ struct hb_bit_set_invertible_t { unlikely (inverted) ? (void) s.add_range (a, b) : s.del_range (a, b); } bool get (hb_codepoint_t g) const { return s.get (g) ^ inverted; } + bool may_have (hb_codepoint_t g) const { return get (g); } /* Has interface. */ bool operator [] (hb_codepoint_t k) const { return get (k); } diff --git a/src/hb-bit-set.hh b/src/hb-bit-set.hh index 8fffa71b4..3b3cb3130 100644 --- a/src/hb-bit-set.hh +++ b/src/hb-bit-set.hh @@ -345,6 +345,7 @@ struct hb_bit_set_t return false; return page->get (g); } + bool may_have (hb_codepoint_t g) const { return get (g); } /* Has interface. */ bool operator [] (hb_codepoint_t k) const { return get (k); } diff --git a/src/hb-set.hh b/src/hb-set.hh index 8ea20bb71..f098bd4c1 100644 --- a/src/hb-set.hh +++ b/src/hb-set.hh @@ -106,6 +106,7 @@ struct hb_sparseset_t void del_range (hb_codepoint_t a, hb_codepoint_t b) { s.del_range (a, b); } bool get (hb_codepoint_t g) const { return s.get (g); } + bool may_have (hb_codepoint_t g) const { return get (g); } /* Has interface. */ bool operator [] (hb_codepoint_t k) const { return get (k); }