summaryrefslogtreecommitdiff
path: root/pango/break.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-10-12 10:28:13 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-10-12 10:28:13 -0400
commit268114b82b988515fc2e1a025ff398aadffcdb10 (patch)
tree8633d6d9be98a405a739aa48b09ed3505d9553d3 /pango/break.c
parent050ebae3a0340e37187319273b5ab443cbe1f0fd (diff)
downloadpango-268114b82b988515fc2e1a025ff398aadffcdb10.tar.gz
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.
Diffstat (limited to 'pango/break.c')
-rw-r--r--pango/break.c8
1 files 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 ||