From a331e913dc99cba1e5994b06cffa2c5cc007f7ff Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 26 Nov 2022 14:59:37 -0700 Subject: [PATCH] [bit-page] Hand-code equality Faster than memcmp() because of alignment. --- src/hb-bit-page.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hb-bit-page.hh b/src/hb-bit-page.hh index 87d0e6143..3f2eb2cb1 100644 --- a/src/hb-bit-page.hh +++ b/src/hb-bit-page.hh @@ -208,7 +208,10 @@ struct hb_bit_page_t bool is_equal (const hb_bit_page_t &other) const { - return 0 == hb_memcmp (&v, &other.v, sizeof (v)); + for (unsigned i = 0; i < len (); i++) + if (v[i] != other.v[i]) + return false; + return true; } bool is_subset (const hb_bit_page_t &larger_page) const {