Skip to content

Commit 1b4bca6

Browse files
committed
Add assertion as optimization hint in php_url_encode_impl()
This avoids the code bloat induced by zend_string_truncate().
1 parent 7e1c8ef commit 1b4bca6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/standard/url.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ static zend_always_inline zend_string *php_url_encode_impl(const char *s, size_t
536536
}
537537
*to = '\0';
538538

539+
ZEND_ASSERT(!ZSTR_IS_INTERNED(start) && GC_REFCOUNT(start) == 1);
539540
start = zend_string_truncate(start, to - (unsigned char*)ZSTR_VAL(start), 0);
540541

541542
return start;

0 commit comments

Comments
 (0)