提交 92aeee3f 编写于 作者: B Behdad Esfahbod

Minor

上级 b9993d8d
......@@ -696,7 +696,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
CFRange range = CTRunGetStringRange (run);
buffer->ensure (buffer->len + range.length);
if (buffer->in_error)
if (unlikely (buffer->in_error))
FAIL ("Buffer resize failed");
hb_glyph_info_t *info = buffer->info + buffer->len;
......@@ -738,7 +738,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
/* Needed buffer size in case we end up using scratch buffer. */
unsigned int alt_size = (sizeof (CGGlyph) + sizeof (CGPoint) + sizeof (CFIndex)) / sizeof (hb_glyph_info_t) + 2;
buffer->ensure (MAX (buffer->len + num_glyphs, alt_size));
if (buffer->in_error)
if (unlikely (buffer->in_error))
FAIL ("Buffer resize failed");
scratch = buffer->get_scratch_buffer (&scratch_size);
......
......@@ -904,7 +904,7 @@ retry:
if (unlikely (hr == E_OUTOFMEMORY))
{
buffer->ensure (buffer->allocated * 2);
if (buffer->in_error)
if (unlikely (buffer->in_error))
FAIL ("Buffer resize failed");
goto retry;
}
......@@ -974,7 +974,7 @@ retry:
#undef utf16_index
buffer->ensure (glyphs_len);
if (buffer->in_error)
if (unlikely (buffer->in_error))
FAIL ("Buffer in error");
#undef FAIL
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册