Skip to content

Commit 5df25a4

Browse files
committed
tweak
1 parent 10bd63a commit 5df25a4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/json/json_encoder.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,7 @@ static zend_result php_json_encode_array(smart_str *buf, zval *val, int options,
374374
}
375375
/* }}} */
376376

377-
/* Outlined smart_str_appendl() to avoid performance loss due to code bloat */
378-
// TODO: now I don't outline it anymore...
377+
/* Specialization of smart_str_appendl() to avoid performance loss due to code bloat */
379378
static zend_always_inline void php_json_append(smart_str *dest, const char *src, size_t len)
380379
{
381380
/* smart_str has a minimum size of the input length,
@@ -387,6 +386,8 @@ static zend_always_inline void php_json_append(smart_str *dest, const char *src,
387386

388387
static zend_always_inline bool php_json_printable_ascii_escape(smart_str *buf, unsigned char us, int options)
389388
{
389+
ZEND_ASSERT(buf->s);
390+
390391
switch (us) {
391392
case '"':
392393
if (options & PHP_JSON_HEX_QUOT) {

0 commit comments

Comments
 (0)