Remove some code
We use scratch-flags to short-circuit this function. No need for previous early loop.
This commit is contained in:
parent
c07b91b812
commit
94368855c6
|
@ -537,23 +537,13 @@ hb_ot_hide_default_ignorables (hb_ot_shape_context_t *c)
|
||||||
unsigned int count = buffer->len;
|
unsigned int count = buffer->len;
|
||||||
hb_glyph_info_t *info = buffer->info;
|
hb_glyph_info_t *info = buffer->info;
|
||||||
hb_glyph_position_t *pos = buffer->pos;
|
hb_glyph_position_t *pos = buffer->pos;
|
||||||
unsigned int i = 0;
|
|
||||||
for (i = 0; i < count; i++)
|
|
||||||
{
|
|
||||||
if (unlikely (_hb_glyph_info_is_default_ignorable (&info[i])))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* No default-ignorables found; return. */
|
|
||||||
if (i == count)
|
|
||||||
return;
|
|
||||||
|
|
||||||
hb_codepoint_t invisible = c->buffer->invisible;
|
hb_codepoint_t invisible = c->buffer->invisible;
|
||||||
if (!(buffer->flags & HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES) &&
|
if (!(buffer->flags & HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES) &&
|
||||||
(invisible || c->font->get_nominal_glyph (' ', &invisible)))
|
(invisible || c->font->get_nominal_glyph (' ', &invisible)))
|
||||||
{
|
{
|
||||||
/* Replace default-ignorables with a zero-advance invisible glyph. */
|
/* Replace default-ignorables with a zero-advance invisible glyph. */
|
||||||
for (/*continue*/; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
if (_hb_glyph_info_is_default_ignorable (&info[i]))
|
if (_hb_glyph_info_is_default_ignorable (&info[i]))
|
||||||
info[i].codepoint = invisible;
|
info[i].codepoint = invisible;
|
||||||
|
@ -563,8 +553,8 @@ hb_ot_hide_default_ignorables (hb_ot_shape_context_t *c)
|
||||||
{
|
{
|
||||||
/* Merge clusters and delete default-ignorables.
|
/* Merge clusters and delete default-ignorables.
|
||||||
* NOTE! We can't use out-buffer as we have positioning data. */
|
* NOTE! We can't use out-buffer as we have positioning data. */
|
||||||
unsigned int j = i;
|
unsigned int j = 0;
|
||||||
for (; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
if (_hb_glyph_info_is_default_ignorable (&info[i]))
|
if (_hb_glyph_info_is_default_ignorable (&info[i]))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue