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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user