From f6aa37159bf1f4b3a2b83c7e263f4642959af73a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 19 Aug 2021 01:12:25 -0600 Subject: [PATCH] [bit-set-invertible] Fix process logic for inverted [# On branch set-invert --- src/hb-bit-set-invertible.hh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hb-bit-set-invertible.hh b/src/hb-bit-set-invertible.hh index aadf8f4e1..ecfe3a186 100644 --- a/src/hb-bit-set-invertible.hh +++ b/src/hb-bit-set-invertible.hh @@ -113,10 +113,7 @@ struct hb_bit_set_invertible_t protected: template void process (const Op& op, const hb_bit_set_invertible_t &other) - { - s.process (op, other.s); - inverted = bool (op (int (inverted), int (other.inverted))); - } + { s.process (op, other.s); } public: void union_ (const hb_bit_set_invertible_t &other) { @@ -134,6 +131,7 @@ struct hb_bit_set_invertible_t else process (hb_bitwise_lt, other); } + inverted = inverted || other.inverted; } void intersect (const hb_bit_set_invertible_t &other) { @@ -151,6 +149,7 @@ struct hb_bit_set_invertible_t else process (hb_bitwise_le, other); } + inverted = inverted && other.inverted; } void subtract (const hb_bit_set_invertible_t &other) { @@ -168,10 +167,12 @@ struct hb_bit_set_invertible_t else process (hb_bitwise_and, other); } + inverted = inverted && !other.inverted; } void symmetric_difference (const hb_bit_set_invertible_t &other) { process (hb_bitwise_xor, other); + inverted = inverted ^ other.inverted; } bool next (hb_codepoint_t *codepoint) const