[subset-cff] Manually grow vector to avoid memset overhead
This commit is contained in:
parent
f455cc53fd
commit
71aa10a394
|
@ -110,12 +110,10 @@ struct str_encoder_t
|
||||||
void copy_str (const hb_ubytes_t &str)
|
void copy_str (const hb_ubytes_t &str)
|
||||||
{
|
{
|
||||||
unsigned int offset = buff.length;
|
unsigned int offset = buff.length;
|
||||||
if (unlikely (!buff.resize (offset + str.length)))
|
/* Manually resize buffer since faster. */
|
||||||
{
|
if ((signed) (buff.length + str.length) <= buff.allocated)
|
||||||
set_error ();
|
buff.length += str.length;
|
||||||
return;
|
else if (unlikely (!buff.resize (offset + str.length)))
|
||||||
}
|
|
||||||
if (unlikely (buff.length < offset + str.length))
|
|
||||||
{
|
{
|
||||||
set_error ();
|
set_error ();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue