[serialize] Movce empty-object handling earlier

This commit is contained in:
Behdad Esfahbod 2019-04-02 17:20:04 -07:00
parent 7f73c9744e
commit e04518bafc
1 changed files with 3 additions and 3 deletions

View File

@ -172,6 +172,9 @@ struct hb_serialize_context_t
obj.tail = head;
unsigned len = obj.tail - obj.head;
if (!len)
return 0;
objidx_t objidx = packed_map.get (&obj);
if (objidx)
{
@ -183,9 +186,6 @@ struct hb_serialize_context_t
memmove (tail, obj.head, len);
head = obj.head;
if (!len)
return 0;
obj.head = tail;
obj.tail = tail + len;