[pango/break-opt] break: Don't determine types more than once



commit 268114b82b988515fc2e1a025ff398aadffcdb10
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Oct 12 10:28:13 2019 -0400

    break: Don't determine types more than once
    
    We determined the category early on, don't
    do the same work again later by calling
    isdigit or isletter wrappers.

 pango/break.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/pango/break.c b/pango/break.c
index 9fa1c47b..ca62a28f 100644
--- a/pango/break.c
+++ b/pango/break.c
@@ -858,11 +858,13 @@ pango_default_break (const gchar   *text,
 
            if (SB_type == SB_Other)
              {
-               if (g_unichar_islower(wc))
+                if (type == G_UNICODE_LOWERCASE_LETTER)
                  SB_type = SB_Lower;
-               else if (g_unichar_isupper(wc))
+                else if (type == G_UNICODE_UPPERCASE_LETTER)
                  SB_type = SB_Upper;
-               else if (g_unichar_isalpha(wc))
+                else if (type == G_UNICODE_TITLECASE_LETTER ||
+                         type == G_UNICODE_MODIFIER_LETTER ||
+                         type == G_UNICODE_OTHER_LETTER)
                  SB_type = SB_OLetter;
 
                if (type == G_UNICODE_OPEN_PUNCTUATION ||


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