We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3dd262 commit 144b0e1Copy full SHA for 144b0e1
ext/json/json_encoder.c
@@ -511,16 +511,14 @@ zend_result php_json_escape_string(
511
int acc = 0;
512
if (mask != 0) {
513
do {
514
- int toggle = mask & -mask;
515
- int bit = __builtin_ctz(mask);
516
- mask ^= toggle;
+ int len = __builtin_ctz(mask);
+ mask >>= len + 1;
517
518
- int len = bit - acc;
519
smart_str_appendl(buf, s, len + pos);
520
521
acc += len + 1;
522
pos += len;
523
- us = (unsigned char) s[pos++];
+ us = (unsigned char)s[pos++];
524
s += pos;
525
pos = 0;
526
0 commit comments