1
0
mirror of https://github.com/php/php-src.git synced 2026-03-25 16:52:18 +01:00

Return early from php_search_array()

This commit is contained in:
Christoph M. Becker
2020-12-04 01:15:48 +01:00
parent fec771db87
commit 8591bb70a4

View File

@@ -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();