mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Slight optimization of php_strtoupper & php_strtoupper functions.
This commit is contained in:
parent
412c2ba7a3
commit
64ef43ecd4
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user