Skip to content

Commit dfb690d

Browse files
committed
Code layout and comment tweak
1 parent 40cd08f commit dfb690d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ext/json/json_encoder.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ static zend_result php_json_encode_array(smart_str *buf, zval *val, int options,
381381
/* Specialization of smart_str_appendl() to avoid performance loss due to code bloat */
382382
static zend_always_inline void php_json_append(smart_str *dest, const char *src, size_t len)
383383
{
384-
/* smart_str has a minimum size of the input length,
384+
/* dest has a minimum size of the input length,
385385
* this avoids generating initial allocation code */
386386
ZEND_ASSERT(dest->s);
387387

@@ -720,9 +720,7 @@ zend_result php_json_escape_string(
720720
|| us < 0x2028 || us > 0x2029)) {
721721
/* No need to emit any bytes, just move the cursor. */
722722
} else {
723-
if (pos_old) {
724-
php_json_append(buf, s, pos_old);
725-
}
723+
php_json_append(buf, s, pos_old);
726724
s += pos;
727725
pos = 0;
728726

0 commit comments

Comments
 (0)