diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2023-12-21 14:04:31 -0500 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2023-12-21 14:04:49 -0500 |
commit | 188ca64934e610666bd05186395429bb2407c264 (patch) | |
tree | 6c29c63d9772f763bbc39390b406caa1aa46204a /newlib | |
parent | 7a45daad9184e30c336f27b3e54b9c5bcc2d3f77 (diff) | |
download | newlib-188ca64934e610666bd05186395429bb2407c264.zip newlib-188ca64934e610666bd05186395429bb2407c264.tar.gz newlib-188ca64934e610666bd05186395429bb2407c264.tar.bz2 |
Optimize strpbrk.c
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/libc/string/strpbrk.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/newlib/libc/string/strpbrk.c b/newlib/libc/string/strpbrk.c index 774db1e..d984745 100644 --- a/newlib/libc/string/strpbrk.c +++ b/newlib/libc/string/strpbrk.c @@ -29,23 +29,16 @@ strpbrk (const char *s1, const char *s2) { const char *c = s2; - if (!*s1) - return (char *) NULL; while (*s1) { for (c = s2; *c; c++) { if (*s1 == *c) - break; + return (char *) s1; } - if (*c) - break; s1++; } - if (*c == '\0') - s1 = NULL; - - return (char *) s1; + return (char *) NULL; } |