From 268114b82b988515fc2e1a025ff398aadffcdb10 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 12 Oct 2019 10:28:13 -0400 Subject: 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(-) (limited to 'pango') 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 || -- cgit v1.2.1