Skip to content

Commit 246b413

Browse files
committed
tweaks
1 parent df0117e commit 246b413

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/json/json_encoder.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ zend_result php_json_escape_string(
678678
#endif
679679

680680
us = (unsigned char)s[pos];
681-
if (EXPECTED(result != PHP_JSON_NON_ASCII && !ZEND_BIT_TEST(charmap, us))) {
681+
if (result != PHP_JSON_NON_ASCII && EXPECTED(!ZEND_BIT_TEST(charmap, us))) {
682682
pos++;
683683
len--;
684684
} else {
@@ -695,9 +695,9 @@ zend_result php_json_escape_string(
695695
if (UNEXPECTED(!us)) {
696696
if (pos_old && (options & (PHP_JSON_INVALID_UTF8_IGNORE|PHP_JSON_INVALID_UTF8_SUBSTITUTE))) {
697697
php_json_append(buf, s, pos_old);
698-
s += pos;
699-
pos = 0;
700698
}
699+
s += pos;
700+
pos = 0;
701701

702702
if (options & PHP_JSON_INVALID_UTF8_IGNORE) {
703703
/* ignore invalid UTF8 character */

0 commit comments

Comments
 (0)