Clean up buffer->swap_buffers() calls

That function checks for buffer->successful already.  No need
to check at call site.
This commit is contained in:
Behdad Esfahbod 2018-11-04 02:25:07 -05:00
parent 4eb52460c8
commit 17335a8161
10 changed files with 6 additions and 17 deletions

View File

@ -211,9 +211,7 @@ print (' }')
print (' if (processed)')
print (' {')
print (' if (buffer->idx < count)')
print (' buffer->next_glyph ();')
print (' if (likely (buffer->successful))')
print (' buffer->swap_buffers ();')
print (' buffer->next_glyph ();')
print (' }')
print ('}')

View File

@ -671,8 +671,7 @@ struct StateTableDriver
{
for (; buffer->successful && buffer->idx < buffer->len;)
buffer->next_glyph ();
if (likely (buffer->successful))
buffer->swap_buffers ();
buffer->swap_buffers ();
}
}

View File

@ -1121,8 +1121,7 @@ struct mortmorx
else
buffer->next_glyph ();
}
if (likely (buffer->successful))
buffer->swap_buffers ();
buffer->swap_buffers ();
}
inline void apply (hb_aat_apply_context_t *c) const

View File

@ -1018,7 +1018,6 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
else
buffer->next_glyph ();
}
buffer->swap_buffers ();
}

View File

@ -414,7 +414,6 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
else
buffer->next_glyph ();
}
buffer->swap_buffers ();
}

View File

@ -343,7 +343,6 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
else
buffer->next_glyph ();
}
buffer->swap_buffers ();
}

View File

@ -357,8 +357,7 @@ preprocess_text_thai (const hb_ot_shape_plan_t *plan,
buffer->merge_out_clusters (start - 1, end);
}
}
if (likely (buffer->successful))
buffer->swap_buffers ();
buffer->swap_buffers ();
/* If font has Thai GSUB, we are done. */
if (plan->props.script == HB_SCRIPT_THAI && !plan->map.found_script[0])

View File

@ -552,7 +552,6 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
else
buffer->next_glyph ();
}
buffer->swap_buffers ();
}

View File

@ -429,9 +429,8 @@ _hb_preprocess_text_vowel_constraints (const hb_ot_shape_plan_t *plan HB_UNUSED,
if (processed)
{
if (buffer->idx < count)
buffer->next_glyph ();
if (likely (buffer->successful))
buffer->swap_buffers ();
buffer->next_glyph ();
buffer->swap_buffers ();
}
}

View File

@ -425,7 +425,6 @@ hb_insert_dotted_circle (hb_buffer_t *buffer, hb_font_t *font)
buffer->output_info (info);
while (buffer->idx < buffer->len && buffer->successful)
buffer->next_glyph ();
buffer->swap_buffers ();
}