提交 4e9ff1dd 编写于 作者: B Behdad Esfahbod

Pre-allocate buffers when adding string

We do a conservative estimate of the number of characters, but still,
this limits the number of buffer reallocs to a small constant.
上级 553bc3de
......@@ -723,6 +723,7 @@ hb_buffer_guess_properties (hb_buffer_t *buffer)
} \
if (item_length == -1) \
item_length = text_length - item_offset; \
buffer->ensure (buffer->len + item_length * sizeof (T) / 4); \
const T *next = (const T *) text + item_offset; \
const T *end = next + item_length; \
while (next < end) { \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册