com php-src: Update documentation/comment for GH-4860: UPGRADING ext/standard/array.c
| From: | Nikita Popov | Date: | Wed, 30 Oct 2019 09:26:56 +0000 |
| Subject: | com php-src: Update documentation/comment for GH-4860: UPGRADING ext/standard/array.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-109129@lists.php.net to get a copy of this message | ||
Commit: 96f361dca08bb6a7c9e0a729b31ac3eefe480215
Author: Tyson Andre <tysonandre775@hotmail.com> Tue, 29 Oct 2019 19:48:28 -0400
Committer: Nikita Popov <nikita.ppv@gmail.com> Wed, 30 Oct 2019 10:26:56 +0100
Parents: fee94da1271ba113baf1145a10dd0d5e7dd74f4f
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=96f361dca08bb6a7c9e0a729b31ac3eefe480215
Log:
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]
Changed paths:
M UPGRADING
M ext/standard/array.c
Diff:
diff --git a/UPGRADING b/UPGRADING
index ba32d55eef9..0bf9bccf432 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -371,6 +371,6 @@ PHP 8.0 UPGRADE NOTES
14. Performance Improvements
========================================
-- array_slice() on a packed array will no longer scan the whole array to find
+- array_slice() on an array without gaps will no longer scan the whole array to find
the start offset. This may significantly reduce the runtime of the function
with large offsets and small lengths.
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 9b501861672..413ed319d79 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -3480,6 +3480,7 @@ static inline Bucket* find_bucket_at_offset(HashTable* ht, zend_long offset)
/* Return a pointer to the end of the bucket array. */
return ht->arData + ht->nNumUsed;
}
+/* }}} */
/* {{{ proto array array_slice(array input, int offset [, int length [, bool preserve_keys]])
Returns elements specified by offset and length */