[serialize] Don't insert empty object into tree
This commit is contained in:
parent
7fd8228326
commit
d74dc3ef65
|
@ -160,6 +160,9 @@ 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;
|
||||||
|
|
||||||
|
@ -304,7 +307,7 @@ struct hb_serialize_context_t
|
||||||
hb_vector_t<object_t> packed;
|
hb_vector_t<object_t> packed;
|
||||||
|
|
||||||
/* Map view of packed objects. */
|
/* Map view of packed objects. */
|
||||||
hb_hashmap_t<const object_t *, objidx_t> packed_map;
|
hb_hashmap_t<const object_t *, objidx_t, nullptr, 0> packed_map;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue