Use RETURN_NEW_STR() in url.c

This avoids an extra branch.
This commit is contained in:
Niels Dossche 2025-04-21 14:52:25 +02:00
parent 1b4bca605c
commit 68794e074b

View file

@ -559,7 +559,7 @@ PHP_FUNCTION(urlencode)
Z_PARAM_STR(in_str) Z_PARAM_STR(in_str)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
RETURN_STR(php_url_encode(ZSTR_VAL(in_str), ZSTR_LEN(in_str))); RETURN_NEW_STR(php_url_encode(ZSTR_VAL(in_str), ZSTR_LEN(in_str)));
} }
/* }}} */ /* }}} */
@ -621,7 +621,7 @@ PHP_FUNCTION(rawurlencode)
Z_PARAM_STR(in_str) Z_PARAM_STR(in_str)
ZEND_PARSE_PARAMETERS_END(); ZEND_PARSE_PARAMETERS_END();
RETURN_STR(php_raw_url_encode(ZSTR_VAL(in_str), ZSTR_LEN(in_str))); RETURN_NEW_STR(php_raw_url_encode(ZSTR_VAL(in_str), ZSTR_LEN(in_str)));
} }
/* }}} */ /* }}} */