Skip to content

Commit 2f25e51

Browse files
committed
ext/standard/array.c: Use return macro
1 parent 9d8f0e7 commit 2f25e51

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

ext/standard/array.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4680,8 +4680,7 @@ PHP_FUNCTION(array_pad)
46804680

46814681
if (input_size >= pad_size_abs) {
46824682
/* Copy the original array */
4683-
ZVAL_COPY(return_value, input);
4684-
return;
4683+
RETURN_COPY(input);
46854684
}
46864685

46874686
num_pads = pad_size_abs - input_size;
@@ -4843,8 +4842,7 @@ PHP_FUNCTION(array_unique)
48434842
ZEND_PARSE_PARAMETERS_END();
48444843

48454844
if (Z_ARRVAL_P(array)->nNumOfElements <= 1) { /* nothing to do */
4846-
ZVAL_COPY(return_value, array);
4847-
return;
4845+
RETURN_COPY(array);
48484846
}
48494847

48504848
if (sort_type == PHP_SORT_STRING) {
@@ -6451,8 +6449,7 @@ PHP_FUNCTION(array_filter)
64516449
ZEND_PARSE_PARAMETERS_END();
64526450

64536451
if (zend_hash_num_elements(Z_ARRVAL_P(array)) == 0) {
6454-
RETVAL_EMPTY_ARRAY();
6455-
return;
6452+
RETURN_EMPTY_ARRAY();
64566453
}
64576454
array_init(return_value);
64586455

@@ -6659,8 +6656,7 @@ PHP_FUNCTION(array_map)
66596656

66606657
/* Short-circuit: if no callback and only one array, just return it. */
66616658
if (!ZEND_FCI_INITIALIZED(fci) || !maxlen) {
6662-
ZVAL_COPY(return_value, &arrays[0]);
6663-
return;
6659+
RETURN_COPY(&arrays[0]);
66646660
}
66656661

66666662
fci.retval = &result;

0 commit comments

Comments
 (0)