From 2579dc648f940c7c66ac0ef2cc75c7b6754c6892 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 19 Aug 2021 14:48:27 -0600 Subject: [PATCH] [bit-set-invertible] Move code around --- src/hb-bit-set-invertible.hh | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/hb-bit-set-invertible.hh b/src/hb-bit-set-invertible.hh index fe3d9fa85..1b12e008e 100644 --- a/src/hb-bit-set-invertible.hh +++ b/src/hb-bit-set-invertible.hh @@ -56,6 +56,21 @@ struct hb_bit_set_invertible_t next (&v); return v == INVALID; } + hb_codepoint_t get_min () const + { + hb_codepoint_t v = INVALID; + next (&v); + return v; + } + hb_codepoint_t get_max () const + { + hb_codepoint_t v = INVALID; + previous (&v); + return v; + } + unsigned int get_population () const + { return inverted ? INVALID - s.get_population () : s.get_population (); } + void add (hb_codepoint_t g) { unlikely (inverted) ? s.del (g) : s.add (g); } bool add_range (hb_codepoint_t a, hb_codepoint_t b) @@ -265,22 +280,6 @@ struct hb_bit_set_invertible_t return true; } - unsigned int get_population () const - { return inverted ? INVALID - s.get_population () : s.get_population (); } - - hb_codepoint_t get_min () const - { - hb_codepoint_t v = INVALID; - next (&v); - return v; - } - hb_codepoint_t get_max () const - { - hb_codepoint_t v = INVALID; - previous (&v); - return v; - } - static constexpr hb_codepoint_t INVALID = hb_bit_set_t::INVALID; /*