1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

Cleanup dead code in array_slice (#10539)

We can only get to this if condition if at least preserve_keys is true.
Therefore, the else branch of this check can never execute.
This commit is contained in:
Niels Dossche
2023-02-08 00:54:42 +01:00
committed by GitHub
parent a26bac7150
commit 3ff8333473

View File

@@ -3616,11 +3616,7 @@ PHP_FUNCTION(array_slice)
break;
}
n++;
if (preserve_keys) {
entry = zend_hash_index_add_new(Z_ARRVAL_P(return_value), idx, zv);
} else {
entry = zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), zv);
}
entry = zend_hash_index_add_new(Z_ARRVAL_P(return_value), idx, zv);
zval_add_ref(entry);
}
}