[subset/cff] Minor optimization

This commit is contained in:
Behdad Esfahbod 2023-06-26 16:34:53 -06:00
parent 570fb4df58
commit c2bab07391

View file

@ -364,6 +364,7 @@ struct FDArray : CFFIndex<COUNT>
sizes.alloc (hb_len (it));
c->push ();
char *data_base = c->head;
+ it
| hb_map ([&] (const hb_pair_t<const DICTVAL&, const INFO&> &_)
{
@ -373,13 +374,14 @@ struct FDArray : CFFIndex<COUNT>
})
| 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<COUNT>::serialize_header (c, hb_iter (sizes)));
return_trace (CFFIndex<COUNT>::serialize_header (c, hb_iter (sizes), data_size));
}
};