[pango/misc-speedups: 3/6] Slightly speed up line breaking




commit 61358958878742a8247b5e2cf727f4e5e4bb3f0d
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Mar 29 00:11:10 2021 -0400

    Slightly speed up line breaking
    
    Make a bit more use of our types.

 pango/break.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/pango/break.c b/pango/break.c
index 35b947c0..7033c659 100644
--- a/pango/break.c
+++ b/pango/break.c
@@ -362,12 +362,15 @@ pango_default_break (const gchar   *text,
         case G_UNICODE_PARAGRAPH_SEPARATOR:
           attrs[i].is_white = TRUE;
           break;
-        default:
+        case G_UNICODE_CONTROL:
           if (wc == '\t' || wc == '\n' || wc == '\r' || wc == '\f')
             attrs[i].is_white = TRUE;
           else
             attrs[i].is_white = FALSE;
           break;
+        default:
+          attrs[i].is_white = FALSE;
+          break;
         }
 
       /* Just few spaces have variable width. So explicitly mark them.


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