提交 6f69c9d2 编写于 作者: B Behdad Esfahbod

[serialize] Minor

上级 a4329019
...@@ -53,7 +53,8 @@ struct hb_serialize_context_t ...@@ -53,7 +53,8 @@ struct hb_serialize_context_t
objidx_t objidx; objidx_t objidx;
}; };
hb_bytes_t bytes; char *head;
unsigned length;
hb_vector_t<link_t> links; hb_vector_t<link_t> links;
}; };
...@@ -83,7 +84,7 @@ struct hb_serialize_context_t ...@@ -83,7 +84,7 @@ struct hb_serialize_context_t
this->current.resize (0); this->current.resize (0);
this->packed.resize (0); this->packed.resize (0);
this->packed.push ()->bytes.arrayZ = this->end; this->packed.push ()->head = this->end;
this->packed_map.reset (); this->packed_map.reset ();
} }
...@@ -162,9 +163,9 @@ struct hb_serialize_context_t ...@@ -162,9 +163,9 @@ struct hb_serialize_context_t
void discard_stale_objects () void discard_stale_objects ()
{ {
while (packed.length > 1 && while (packed.length > 1 &&
packed.tail ().bytes.arrayZ < tail) packed.tail ().head < tail)
packed.pop (); packed.pop ();
assert (packed.tail ().bytes.arrayZ == tail); assert (packed.tail ().head == tail);
} }
unsigned int length () const { return this->head - current.tail ().head; } unsigned int length () const { return this->head - current.tail ().head; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册