Skip to content

Commit 144b0e1

Browse files
committed
shift opt
1 parent a3dd262 commit 144b0e1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ext/json/json_encoder.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,16 +511,14 @@ zend_result php_json_escape_string(
511511
int acc = 0;
512512
if (mask != 0) {
513513
do {
514-
int toggle = mask & -mask;
515-
int bit = __builtin_ctz(mask);
516-
mask ^= toggle;
514+
int len = __builtin_ctz(mask);
515+
mask >>= len + 1;
517516

518-
int len = bit - acc;
519517
smart_str_appendl(buf, s, len + pos);
520518

521519
acc += len + 1;
522520
pos += len;
523-
us = (unsigned char) s[pos++];
521+
us = (unsigned char)s[pos++];
524522
s += pos;
525523
pos = 0;
526524

0 commit comments

Comments
 (0)