diff options
author | Bruno Haible <bruno@clisp.org> | 2010-07-18 17:23:36 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2010-07-18 17:23:36 +0200 |
commit | e240ab433593692f27c804c26ec1730a0dd27e5d (patch) | |
tree | b1a4b1024dc38441bcf35baac2172f9f9f8430b4 /lib | |
parent | afc6cbe4fe4892c5ee4166cab87fede6f294a27d (diff) | |
download | gnulib-e240ab433593692f27c804c26ec1730a0dd27e5d.tar.gz |
unistr/u8-strchr: Optimize non-ASCII argument case.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unistr/u8-strchr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/unistr/u8-strchr.c b/lib/unistr/u8-strchr.c index 0b5e993d1d..3ee246521e 100644 --- a/lib/unistr/u8-strchr.c +++ b/lib/unistr/u8-strchr.c @@ -68,7 +68,7 @@ u8_strchr (const uint8_t *s, ucs4_t uc) { if (s[1] == 0) goto notfound; - if (*s == c0 && s[1] == c1) + if (s[1] == c1 && *s == c0) break; } return (uint8_t *) s; @@ -86,7 +86,7 @@ u8_strchr (const uint8_t *s, ucs4_t uc) { if (s[2] == 0) goto notfound; - if (*s == c0 && s[1] == c1 && s[2] == c2) + if (s[2] == c2 && s[1] == c1 && *s == c0) break; } return (uint8_t *) s; @@ -105,7 +105,7 @@ u8_strchr (const uint8_t *s, ucs4_t uc) { if (s[3] == 0) goto notfound; - if (*s == c0 && s[1] == c1 && s[2] == c2 && s[3] == c3) + if (s[3] == c3 && s[2] == c2 && s[1] == c1 && *s == c0) break; } return (uint8_t *) s; |