Skip to content

Commit fa78da9

Browse files
committed
Optimize strtolower()/strtoupper()
1 parent ac69320 commit fa78da9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/standard/string.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ PHPAPI zend_string *php_string_toupper(zend_string *s)
14391439
e = c + ZSTR_LEN(s);
14401440

14411441
while (c < e) {
1442-
if (!isupper(*c)) {
1442+
if (islower(*c)) {
14431443
register unsigned char *r;
14441444
zend_string *res = zend_string_alloc(ZSTR_LEN(s), 0);
14451445

@@ -1508,7 +1508,7 @@ PHPAPI zend_string *php_string_tolower(zend_string *s)
15081508
e = c + ZSTR_LEN(s);
15091509

15101510
while (c < e) {
1511-
if (!islower(*c)) {
1511+
if (isupper(*c)) {
15121512
register unsigned char *r;
15131513
zend_string *res = zend_string_alloc(ZSTR_LEN(s), 0);
15141514

0 commit comments

Comments
 (0)