From 570fb4df58fcaa58c82b363f4edb5d61f1d948fb Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 26 Jun 2023 16:26:12 -0600 Subject: [PATCH] [subset/cff] Add a vector pre-alloc --- src/hb-ot-cff-common.hh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index 43910a5f7..f285dad67 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh @@ -360,6 +360,9 @@ struct FDArray : CFFIndex /* serialize INDEX data */ hb_vector_t sizes; + if (it.is_random_access_iterator) + sizes.alloc (hb_len (it)); + c->push (); + it | hb_map ([&] (const hb_pair_t &_)