From 68b944ccd2bbecda0f13fbc7f89940651052fb5d Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Sun, 12 Feb 2023 04:02:23 +0000 Subject: harfbuzz 7.0.0 git-svn-id: svn://tug.org/texlive/trunk@65798 c570f23f-e606-0410-a88d-b1316a301751 --- .../libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh') diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh index 8de6e037fbd..475b07b810b 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh @@ -38,7 +38,7 @@ struct hb_bit_set_t hb_bit_set_t () = default; ~hb_bit_set_t () = default; - hb_bit_set_t (const hb_bit_set_t& other) : hb_bit_set_t () { set (other); } + hb_bit_set_t (const hb_bit_set_t& other) : hb_bit_set_t () { set (other, true); } hb_bit_set_t ( hb_bit_set_t&& other) : hb_bit_set_t () { hb_swap (*this, other); } hb_bit_set_t& operator= (const hb_bit_set_t& other) { set (other); return *this; } hb_bit_set_t& operator= (hb_bit_set_t&& other) { hb_swap (*this, other); return *this; } @@ -85,12 +85,16 @@ struct hb_bit_set_t void err () { if (successful) successful = false; } /* TODO Remove */ bool in_error () const { return !successful; } - bool resize (unsigned int count, bool clear = true) + bool resize (unsigned int count, bool clear = true, bool exact_size = false) { if (unlikely (!successful)) return false; - if (unlikely (!pages.resize (count, clear) || !page_map.resize (count, clear))) + + if (pages.length == 0 && count == 1) + exact_size = true; // Most sets are small and local + + if (unlikely (!pages.resize (count, clear, exact_size) || !page_map.resize (count, clear, exact_size))) { - pages.resize (page_map.length); + pages.resize (page_map.length, clear, exact_size); successful = false; return false; } @@ -346,11 +350,11 @@ struct hb_bit_set_t hb_codepoint_t c = first - 1; return next (&c) && c <= last; } - void set (const hb_bit_set_t &other) + void set (const hb_bit_set_t &other, bool exact_size = false) { if (unlikely (!successful)) return; unsigned int count = other.pages.length; - if (unlikely (!resize (count, false))) + if (unlikely (!resize (count, false, exact_size))) return; population = other.population; @@ -422,7 +426,7 @@ struct hb_bit_set_t private: bool allocate_compact_workspace (hb_vector_t& workspace) { - if (unlikely (!workspace.resize (pages.length))) + if (unlikely (!workspace.resize_exact (pages.length))) { successful = false; return false; -- cgit v1.2.3