Commit 148ebf98 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

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.
parent 13015a0a
......@@ -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';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment