[serialize] Only pack main object if there are other objects
Avoids a memmove for tables that don't use the object packing mechanism.
This commit is contained in:
parent
946d446f9b
commit
f254f45a1e
|
@ -122,8 +122,11 @@ struct hb_serialize_context_t
|
||||||
/* TODO Propagate errors. */
|
/* TODO Propagate errors. */
|
||||||
|
|
||||||
assert (current.length == 1);
|
assert (current.length == 1);
|
||||||
/* TODO Enable when callers are updated. */
|
|
||||||
//pop_pack ();
|
/* Only "pack" if there exist other objects... Otherwise, don't bother.
|
||||||
|
* Saves a copy. */
|
||||||
|
if (packed.length > 1)
|
||||||
|
pop_pack ();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
|
|
Loading…
Reference in New Issue