]> granicus.if.org Git - php/commitdiff
use pointer arithmetic for the normal zend_str_tolower()
authorSterling Hughes <sterling@php.net>
Tue, 20 May 2003 20:39:58 +0000 (20:39 +0000)
committerSterling Hughes <sterling@php.net>
Tue, 20 May 2003 20:39:58 +0000 (20:39 +0000)
Zend/zend_operators.c

index fe20ab9c09e363ab9adc174175c24e2d4d2db48b..4df314226ffb42b9d6d66bff425229ee8c9a0cc3 100644 (file)
@@ -1596,10 +1596,12 @@ ZEND_API char *zend_str_tolower_copy(char *str, unsigned int length)
 ZEND_API void zend_str_tolower(char *str, unsigned int length)
 {
        register char *p=str;
-       
-       do {
-               p[length] = tolower(p[length]);
-       } while (length--);
+       register char *end = str + length;
+
+       while (p < end) {
+               *p = tolower(*p);
+               p++;
+       }
 }
 
 ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2)