From c2bab073916870f336ca0b4b658bf70aa99a401c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 26 Jun 2023 16:34:53 -0600 Subject: [PATCH] [subset/cff] Minor optimization --- src/hb-ot-cff-common.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index f285dad67..57ec522e8 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh @@ -364,6 +364,7 @@ struct FDArray : CFFIndex sizes.alloc (hb_len (it)); c->push (); + char *data_base = c->head; + it | hb_map ([&] (const hb_pair_t &_) { @@ -373,13 +374,14 @@ struct FDArray : CFFIndex }) | hb_sink (sizes) ; + unsigned data_size = c->head - data_base; c->pop_pack (false); /* It just happens that the above is packed right after the header below. * Such a hack. */ /* serialize INDEX header */ - return_trace (CFFIndex::serialize_header (c, hb_iter (sizes))); + return_trace (CFFIndex::serialize_header (c, hb_iter (sizes), data_size)); } };