about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-09-14 20:41:30 +0000
committerUlrich Drepper <drepper@redhat.com>2001-09-14 20:41:30 +0000
commit29215bbd7eb8e2f03881ccc039338d2b2c369995 (patch)
tree05ae1be061dbc04a9863596142f5230b2fdc7b16
parent0991cbf654ef86bc9e0c3a0d940be7f00ac1be71 (diff)
downloadglibc-29215bbd7eb8e2f03881ccc039338d2b2c369995.tar.gz
glibc-29215bbd7eb8e2f03881ccc039338d2b2c369995.tar.xz
glibc-29215bbd7eb8e2f03881ccc039338d2b2c369995.zip
Update.
	* string/bits/string2.h (__strtok_r_1c): Optimize a bit.
-rw-r--r--ChangeLog2
-rw-r--r--string/bits/string2.h16
2 files changed, 9 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 5ffa57f69a..2d02070860 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2001-09-14  Ulrich Drepper  <drepper@redhat.com>
 
+	* string/bits/string2.h (__strtok_r_1c): Optimize a bit.
+
 	* sysdeps/unix/sysv/linux/net/ethernet.h: Correct references to
 	ETHER_CRC_LEN.
 
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;
 }