[set] Add may_have() as alias for get()

pull/5043/head
Behdad Esfahbod 1 week ago
parent ad7f428be4
commit c05002afb8
  1. 1
      src/hb-bit-page.hh
  2. 1
      src/hb-bit-set-invertible.hh
  3. 1
      src/hb-bit-set.hh
  4. 1
      src/hb-set.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); }

@ -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); }

@ -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); }

@ -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); }

Loading…
Cancel
Save