diff options
author | Ondřej Bílka <neleai@seznam.cz> | 2015-06-29 17:47:01 +0200 |
---|---|---|
committer | Ondřej Bílka <neleai@seznam.cz> | 2015-08-20 09:53:36 +0200 |
commit | 0e974603c566e8e25ffcf8a86d214c400f111090 (patch) | |
tree | fc40bcc79e8bf8df9818fc6546e620db534fd679 /string/test-strcspn.c | |
parent | 165308eb2c66542c88d002d63dc68df112f5c818 (diff) | |
download | glibc-neleai/string-x64.tar glibc-neleai/string-x64.tar.gz glibc-neleai/string-x64.tar.bz2 glibc-neleai/string-x64.zip |
Improve generic strpbrk.neleai/string-x64
Diffstat (limited to 'string/test-strcspn.c')
-rw-r--r-- | string/test-strcspn.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/string/test-strcspn.c b/string/test-strcspn.c index b60a048c5c..50a06e44c4 100644 --- a/string/test-strcspn.c +++ b/string/test-strcspn.c @@ -31,18 +31,9 @@ IMPL (stupid_strcspn, 0) IMPL (simple_strcspn, 0) IMPL (strcspn, 1) -size_t -simple_strcspn (const char *s, const char *rej) -{ - const char *r, *str = s; - char c; - - while ((c = *s++) != '\0') - for (r = rej; *r != '\0'; ++r) - if (*r == c) - return s - str - 1; - return s - str - 1; -} +#define AS_STRCSPN +#define STRPBRK simple_strcspn +#include "string/strpbrk.c" size_t stupid_strcspn (const char *s, const char *rej) |