Skip to content

Commit 55f8c14

Browse files
committed
Avoid unnecessary comparison
The first element of the `arrays` serves as base for the comparison, so there is no need to compare it to itself. Closes GH-9246.
1 parent 3663f76 commit 55f8c14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/standard/array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5718,7 +5718,7 @@ PHP_FUNCTION(array_multisort)
57185718

57195719
/* Make sure the arrays are of the same size. */
57205720
array_size = zend_hash_num_elements(Z_ARRVAL_P(arrays[0]));
5721-
for (i = 0; i < num_arrays; i++) {
5721+
for (i = 1; i < num_arrays; i++) {
57225722
if (zend_hash_num_elements(Z_ARRVAL_P(arrays[i])) != (uint32_t)array_size) {
57235723
zend_value_error("Array sizes are inconsistent");
57245724
MULTISORT_ABORT;

0 commit comments

Comments
 (0)