PERFORCE change 106138 for review

Warner Losh imp at FreeBSD.org
Fri Sep 15 00:27:12 PDT 2006


http://perforce.freebsd.org/chv.cgi?CH=106138

Change 106138 by imp at imp_lighthouse on 2006/09/15 07:27:04

	reimplement strlen.  Saves another 16 bytes (20 so far).

Affected files ...

.. //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#11 edit

Differences ...

==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#11 (text+ko) ====

@@ -50,10 +50,10 @@
 int
 p_strlen(const char *buffer)
 {
-	int	len = 0;
-	while (buffer[len])
-		len++;
-	return (len);
+	const char *ptr = buffer;
+	while (*ptr++)
+		continue;
+	return (ptr - buffer);
 }
 
 


More information about the p4-projects mailing list