mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Add assertion as optimization hint in php_url_encode_impl()
This avoids the code bloat induced by zend_string_truncate().
This commit is contained in:
@@ -536,6 +536,7 @@ static zend_always_inline zend_string *php_url_encode_impl(const char *s, size_t
|
||||
}
|
||||
*to = '\0';
|
||||
|
||||
ZEND_ASSERT(!ZSTR_IS_INTERNED(start) && GC_REFCOUNT(start) == 1);
|
||||
start = zend_string_truncate(start, to - (unsigned char*)ZSTR_VAL(start), 0);
|
||||
|
||||
return start;
|
||||
|
||||
Reference in New Issue
Block a user