diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-08-22 00:57:25 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-08-25 12:15:45 -0400 |
commit | 148ebf98edb498d786f4c1107ec116e1afdf9541 (patch) | |
tree | f59942c7809e25ea3aa63f612011a2b8b7e4f25c /src/fcstr.c | |
parent | 13015a0a6ed15ef2e0241a92ef05233dc51ce23b (diff) | |
download | fontconfig-148ebf98edb498d786f4c1107ec116e1afdf9541.tar.gz |
Use __builtin_expect in a few places
utf8 is extremely rare in the strings we see in
font configuration, so this seems to be a good
case for __builtin_expect.
Diffstat (limited to 'src/fcstr.c')
-rw-r--r-- | src/fcstr.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/fcstr.c b/src/fcstr.c index dc9940a..f1f75dc 100644 --- a/src/fcstr.c +++ b/src/fcstr.c @@ -164,7 +164,7 @@ FcStrCaseWalkerNextNonDelim (FcCaseWalker *w, const char *delims) { FcChar8 r; - if (w->read) + if (__builtin_expect (w->read != NULL, 0)) { if ((r = *w->read++)) return r; @@ -175,7 +175,7 @@ FcStrCaseWalkerNextNonDelim (FcCaseWalker *w, const char *delims) r = *w->src++; } while (r != 0 && delims && strchr (delims, r)); - if ((r & 0xc0) == 0xc0) + if (__builtin_expect ((r & 0xc0) == 0xc0, 0)) return FcStrCaseWalkerLong (w, r); if ('A' <= r && r <= 'Z') r = r - 'A' + 'a'; @@ -187,7 +187,7 @@ FcStrCaseWalkerNextNonBlank (FcCaseWalker *w) { FcChar8 r; - if (w->read) + if (__builtin_expect (w->read != NULL, 0)) { if ((r = *w->read++)) return r; @@ -198,7 +198,7 @@ FcStrCaseWalkerNextNonBlank (FcCaseWalker *w) r = *w->src++; } while (r == ' '); - if ((r & 0xc0) == 0xc0) + if (__builtin_expect ((r & 0xc0) == 0xc0, 0)) return FcStrCaseWalkerLong (w, r); if ('A' <= r && r <= 'Z') r = r - 'A' + 'a'; @@ -210,7 +210,7 @@ FcStrCaseWalkerNext (FcCaseWalker *w) { FcChar8 r; - if (w->read) + if (__builtin_expect (w->read != NULL, 0)) { if ((r = *w->read++)) return r; @@ -219,7 +219,7 @@ FcStrCaseWalkerNext (FcCaseWalker *w) r = *w->src++; - if ((r & 0xc0) == 0xc0) + if (__builtin_expect ((r & 0xc0) == 0xc0, 0)) return FcStrCaseWalkerLong (w, r); if ('A' <= r && r <= 'Z') r = r - 'A' + 'a'; |