Skip to content

Commit 96f361d

Browse files
TysonAndrenikic
authored andcommitted
Update documentation/comment for GH-4860
Fix folding for the new helper method. Clarify comment in UPGRADING: The performance on associative arrays would also improve, as long as no offsets were unset (no gaps). Packed arrays can have gaps. Closes GH-4873. [ci skip]
1 parent fee94da commit 96f361d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

UPGRADING

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,6 @@ PHP 8.0 UPGRADE NOTES
371371
14. Performance Improvements
372372
========================================
373373

374-
- array_slice() on a packed array will no longer scan the whole array to find
374+
- array_slice() on an array without gaps will no longer scan the whole array to find
375375
the start offset. This may significantly reduce the runtime of the function
376376
with large offsets and small lengths.

ext/standard/array.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3480,6 +3480,7 @@ static inline Bucket* find_bucket_at_offset(HashTable* ht, zend_long offset)
34803480
/* Return a pointer to the end of the bucket array. */
34813481
return ht->arData + ht->nNumUsed;
34823482
}
3483+
/* }}} */
34833484

34843485
/* {{{ proto array array_slice(array input, int offset [, int length [, bool preserve_keys]])
34853486
Returns elements specified by offset and length */

0 commit comments

Comments
 (0)