[subset/cff] Minor optimization

This commit is contained in:
Behdad Esfahbod committed 2023-06-26 16:41:55 -06:00
1 parent 570fb4df58
commit c2bab07391
1 file changed
+3 -1
+3 -1
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));
}
};