[cff] Adjust buffer pre-allocation
Most ops take one or two bytes, so allocate count*2, not count*3. Shows minor speedup in subsetting benchmark (around 2%).
This commit is contained in:
parent
4b2caafea2
commit
191025cc96
|
@ -856,7 +856,7 @@ struct subr_subsetter_t
|
|||
unsigned count = str.get_count ();
|
||||
str_encoder_t encoder (buff);
|
||||
encoder.reset ();
|
||||
buff.alloc (count * 3);
|
||||
buff.alloc (count * 2);
|
||||
/* if a prefix (CFF1 width or CFF2 vsindex) has been removed along with hints,
|
||||
* re-insert it at the beginning of charstreing */
|
||||
if (str.has_prefix () && str.is_hint_dropped ())
|
||||
|
|
Loading…
Reference in New Issue