[serialize] Movce empty-object handling earlier
This commit is contained in:
parent
7f73c9744e
commit
e04518bafc
|
@ -172,6 +172,9 @@ struct hb_serialize_context_t
|
||||||
obj.tail = head;
|
obj.tail = head;
|
||||||
unsigned len = obj.tail - obj.head;
|
unsigned len = obj.tail - obj.head;
|
||||||
|
|
||||||
|
if (!len)
|
||||||
|
return 0;
|
||||||
|
|
||||||
objidx_t objidx = packed_map.get (&obj);
|
objidx_t objidx = packed_map.get (&obj);
|
||||||
if (objidx)
|
if (objidx)
|
||||||
{
|
{
|
||||||
|
@ -183,9 +186,6 @@ struct hb_serialize_context_t
|
||||||
memmove (tail, obj.head, len);
|
memmove (tail, obj.head, len);
|
||||||
head = obj.head;
|
head = obj.head;
|
||||||
|
|
||||||
if (!len)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
obj.head = tail;
|
obj.head = tail;
|
||||||
obj.tail = tail + len;
|
obj.tail = tail + len;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue