From 29215bbd7eb8e2f03881ccc039338d2b2c369995 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 14 Sep 2001 20:41:30 +0000 Subject: Update. * string/bits/string2.h (__strtok_r_1c): Optimize a bit. --- string/bits/string2.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'string') diff --git a/string/bits/string2.h b/string/bits/string2.h index 1caa81b403..09a49b6fff 100644 --- a/string/bits/string2.h +++ b/string/bits/string2.h @@ -1044,15 +1044,13 @@ __strtok_r_1c (char *__s, char __sep, char **__nextp) else { __result = __s; - while (*__s != '\0' && *__s != __sep) - ++__s; - if (*__s == '\0') - *__nextp = __s; - else - { - *__s = '\0'; - *__nextp = __s + 1; - } + while (*__s != '\0') + if (*__s++ == __sep) + { + __s[-1] = '\0'; + break; + } + *__nextp = __s; } return __result; } -- cgit 1.4.1