From dc4ff7012cc25c6735916d506a57cef066e8523e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 5 Feb 2025 10:42:33 +0000 Subject: [PATCH] [bit-page] Add a couple of operators --- src/hb-bit-page.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hb-bit-page.hh b/src/hb-bit-page.hh index df08c834e..373733c74 100644 --- a/src/hb-bit-page.hh +++ b/src/hb-bit-page.hh @@ -89,6 +89,8 @@ struct hb_vector_size_t struct hb_bit_page_t { + hb_bit_page_t () { init0 (); } + void init0 () { v.init0 (); population = 0; } void init1 () { v.init1 (); population = PAGE_BITS; } @@ -116,6 +118,9 @@ struct hb_bit_page_t 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 operator [] (hb_codepoint_t g) const { return get (g); } + bool operator () (hb_codepoint_t g) const { return get (g); } + void add_range (hb_codepoint_t a, hb_codepoint_t b) { elt_t *la = &elt (a);