[buffer-verify] Simplify a couple ifs

This commit is contained in:
Behdad Esfahbod committed 2023-06-08 15:58:38 -06:00
1 parent e527c17e23
commit c85ca75eff
1 file changed
+6 -13
+6 -13
View File
@@ -162,13 +162,8 @@ buffer_verify_unsafe_to_break (hb_buffer_t *buffer,
hb_buffer_set_flags (fragment, flags);
hb_buffer_append (fragment, text_buffer, text_start, text_end);
if (!hb_shape_full (font, fragment, features, num_features, shapers))
{
hb_buffer_destroy (reconstruction);
hb_buffer_destroy (fragment);
return true;
}
else if (!fragment->successful || fragment->shaping_failed)
if (!hb_shape_full (font, fragment, features, num_features, shapers) ||
fragment->successful || fragment->shaping_failed)
{
hb_buffer_destroy (reconstruction);
hb_buffer_destroy (fragment);
@@ -318,14 +313,12 @@ buffer_verify_unsafe_to_concat (hb_buffer_t *buffer,
/*
* Shape the two fragment streams.
*/
if (!hb_shape_full (font, fragments[0], features, num_features, shapers))
goto out;
else if (!fragments[0]->successful || fragments[0]->shaping_failed)
if (!hb_shape_full (font, fragments[0], features, num_features, shapers) ||
!fragments[0]->successful || fragments[0]->shaping_failed)
goto out;
if (!hb_shape_full (font, fragments[1], features, num_features, shapers))
goto out;
else if (!fragments[1]->successful || fragments[1]->shaping_failed)
if (!hb_shape_full (font, fragments[1], features, num_features, shapers) ||
!fragments[1]->successful || fragments[1]->shaping_failed)
goto out;
if (!forward)