From eec1a25e7169a2958a4f739d98cca4ae6e38605f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 19 Aug 2021 13:22:36 -0600 Subject: [PATCH] [bit-set-invertible] Rewrite get_min/max() in terms of next/previous() --- src/hb-bit-set-invertible.hh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/hb-bit-set-invertible.hh b/src/hb-bit-set-invertible.hh index 9cc6c1694..4bbda2524 100644 --- a/src/hb-bit-set-invertible.hh +++ b/src/hb-bit-set-invertible.hh @@ -262,9 +262,17 @@ struct hb_bit_set_invertible_t { return inverted ? INVALID - s.get_population () : s.get_population (); } hb_codepoint_t get_min () const - { return s.get_min (inverted); } + { + hb_codepoint_t v = INVALID; + next (&v); + return v; + } hb_codepoint_t get_max () const - { return unlikely (inverted) ? /*XXX*/ INVALID - 1 : s.get_max (); } + { + hb_codepoint_t v = INVALID; + previous (&v); + return v; + } static constexpr hb_codepoint_t INVALID = hb_bit_set_t::INVALID;