[pango/tab-speedup: 4/4] layout: Optimize tab handling




commit 253461f9dd2984ee00216b7292e27bb910fed816
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Dec 1 23:32:48 2021 -0500

    layout: Optimize tab handling
    
    We don't need to iterate the entire tab array
    every time, we just continue from the previous
    tab stop position.

 pango/pango-layout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 27755d67..a9d07940 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -3541,7 +3541,7 @@ shape_tab (PangoLayoutLine  *line,
   ensure_tab_width (line->layout);
   space_width = line->layout->tab_width / 8;
 
-  for (i = 0; ; i++)
+  for (i = tab_state->index; ; i++)
     {
       gboolean is_default;
 


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