[gtk/ngl-text-tweaks: 14/15] ngl: Avoid a goto




commit 5e343f4af0e703392b957a397a934826cf80fdce
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Mar 28 20:53:46 2021 -0400

    ngl: Avoid a goto
    
    Reshuffle the code slightly, so we can use a continue
    instead.

 gsk/ngl/gsknglrenderjob.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gsk/ngl/gsknglrenderjob.c b/gsk/ngl/gsknglrenderjob.c
index fa2c9c8cb9..5dfd78b5c8 100644
--- a/gsk/ngl/gsknglrenderjob.c
+++ b/gsk/ngl/gsknglrenderjob.c
@@ -2736,9 +2736,11 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob     *job,
           cy = ypos;
         }
 
+      x_position += gi->geometry.width;
+
       texture_id = gsk_ngl_glyph_library_lookup_or_add (library, &lookup, &glyph);
       if G_UNLIKELY (texture_id == 0)
-        goto next;
+        continue;
 
       if G_UNLIKELY (last_texture != texture_id)
         {
@@ -2784,9 +2786,6 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob     *job,
 
       batch->draw.vbo_count += GSK_NGL_N_VERTICES;
       used++;
-
-next:
-      x_position += gi->geometry.width;
     }
 
   if (used != num_glyphs)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]