From 8591bb70a4b22a3bb7ca897bface89fcc2b85d64 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Fri, 4 Dec 2020 01:15:48 +0100 Subject: [PATCH] Return early from php_search_array() --- ext/standard/array.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 3a50e77100..7af639dc49 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1526,11 +1526,10 @@ static inline void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) RETURN_TRUE; } else { if (str_idx) { - RETVAL_STR_COPY(str_idx); + RETURN_STR_COPY(str_idx); } else { - RETVAL_LONG(num_idx); + RETURN_LONG(num_idx); } - return; } } } ZEND_HASH_FOREACH_END(); @@ -1542,11 +1541,10 @@ static inline void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) RETURN_TRUE; } else { if (str_idx) { - RETVAL_STR_COPY(str_idx); + RETURN_STR_COPY(str_idx); } else { - RETVAL_LONG(num_idx); + RETURN_LONG(num_idx); } - return; } } } ZEND_HASH_FOREACH_END(); @@ -1559,11 +1557,10 @@ static inline void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) RETURN_TRUE; } else { if (str_idx) { - RETVAL_STR_COPY(str_idx); + RETURN_STR_COPY(str_idx); } else { - RETVAL_LONG(num_idx); + RETURN_LONG(num_idx); } - return; } } } ZEND_HASH_FOREACH_END(); @@ -1574,11 +1571,10 @@ static inline void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) RETURN_TRUE; } else { if (str_idx) { - RETVAL_STR_COPY(str_idx); + RETURN_STR_COPY(str_idx); } else { - RETVAL_LONG(num_idx); + RETURN_LONG(num_idx); } - return; } } } ZEND_HASH_FOREACH_END(); @@ -1589,11 +1585,10 @@ static inline void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) RETURN_TRUE; } else { if (str_idx) { - RETVAL_STR_COPY(str_idx); + RETURN_STR_COPY(str_idx); } else { - RETVAL_LONG(num_idx); + RETURN_LONG(num_idx); } - return; } } } ZEND_HASH_FOREACH_END(); -- 2.50.1