Slight optimization of php_strtoupper & php_strtoupper functions.

This commit is contained in:
Ilia Alshanetsky 2002-08-25 19:08:07 +00:00
parent 412c2ba7a3
commit 64ef43ecd4

View File

@ -942,14 +942,14 @@ restore:
*/
PHPAPI char *php_strtoupper(char *s, size_t len)
{
char *c;
int ch;
size_t i;
char *c, *e;
c = s;
for (i=0; i<len; i++) {
ch = toupper((unsigned char)*c);
*c++ = ch;
e = c+len;
while (c<e) {
*c = toupper(*c);
c++;
}
return s;
}
@ -976,14 +976,14 @@ PHP_FUNCTION(strtoupper)
*/
PHPAPI char *php_strtolower(char *s, size_t len)
{
register int ch;
char *c;
size_t i;
char *c, *e;
c = s;
for (i=0; i<len; i++) {
ch = tolower((unsigned char)*c);
*c++ = ch;
e = c+len;
while (c<e) {
*c = tolower(*c);
c++;
}
return s;
}