From fa78da99010ef3edcae216d969e7f81ca53a22d8 Mon Sep 17 00:00:00 2001 From: Yoshio HANAWA Date: Sun, 13 Dec 2015 14:22:50 +0900 Subject: [PATCH] Optimize strtolower()/strtoupper() --- ext/standard/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/string.c b/ext/standard/string.c index 3922ff497d..01c7c6dffe 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1439,7 +1439,7 @@ PHPAPI zend_string *php_string_toupper(zend_string *s) e = c + ZSTR_LEN(s); while (c < e) { - if (!isupper(*c)) { + if (islower(*c)) { register unsigned char *r; 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); while (c < e) { - if (!islower(*c)) { + if (isupper(*c)) { register unsigned char *r; zend_string *res = zend_string_alloc(ZSTR_LEN(s), 0); -- 2.40.0