Optimize strtolower()/strtoupper()

This commit is contained in:
Yoshio HANAWA 2015-12-13 14:22:50 +09:00
parent ac693205b1
commit fa78da9901

View file

@ -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);