Skip to content

Commit 080cf10

Browse files
committed
array_map: Move fci configuration outside of loop
1 parent f4c3097 commit 080cf10

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/standard/array.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6916,6 +6916,10 @@ PHP_FUNCTION(array_map)
69166916
} else {
69176917
zval *params = (zval *)safe_emalloc(n_arrays, sizeof(zval), 0);
69186918

6919+
fci.retval = &result;
6920+
fci.param_count = n_arrays;
6921+
fci.params = params;
6922+
69196923
/* We iterate through all the arrays at once. */
69206924
for (k = 0; k < maxlen; k++) {
69216925
for (i = 0; i < n_arrays; i++) {
@@ -6949,10 +6953,6 @@ PHP_FUNCTION(array_map)
69496953
}
69506954
}
69516955

6952-
fci.retval = &result;
6953-
fci.param_count = n_arrays;
6954-
fci.params = params;
6955-
69566956
zend_result ret = zend_call_function(&fci, &fci_cache);
69576957
ZEND_ASSERT(ret == SUCCESS);
69586958
ZEND_IGNORE_VALUE(ret);

0 commit comments

Comments
 (0)