mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Optimize strtolower()/strtoupper()
This commit is contained in:
parent
ac693205b1
commit
fa78da9901
1 changed files with 2 additions and 2 deletions
|
@ -1439,7 +1439,7 @@ PHPAPI zend_string *php_string_toupper(zend_string *s)
|
||||||
e = c + ZSTR_LEN(s);
|
e = c + ZSTR_LEN(s);
|
||||||
|
|
||||||
while (c < e) {
|
while (c < e) {
|
||||||
if (!isupper(*c)) {
|
if (islower(*c)) {
|
||||||
register unsigned char *r;
|
register unsigned char *r;
|
||||||
zend_string *res = zend_string_alloc(ZSTR_LEN(s), 0);
|
zend_string *res = zend_string_alloc(ZSTR_LEN(s), 0);
|
||||||
|
|
||||||
|
@ -1508,7 +1508,7 @@ PHPAPI zend_string *php_string_tolower(zend_string *s)
|
||||||
e = c + ZSTR_LEN(s);
|
e = c + ZSTR_LEN(s);
|
||||||
|
|
||||||
while (c < e) {
|
while (c < e) {
|
||||||
if (!islower(*c)) {
|
if (isupper(*c)) {
|
||||||
register unsigned char *r;
|
register unsigned char *r;
|
||||||
zend_string *res = zend_string_alloc(ZSTR_LEN(s), 0);
|
zend_string *res = zend_string_alloc(ZSTR_LEN(s), 0);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue