mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Preallocate result array size in simplexml xpath
This is the simplexml version of 4dea42a
.
This commit is contained in:
parent
0ea268b51a
commit
d18bab5562
1 changed files with 2 additions and 1 deletions
|
@ -1309,7 +1309,8 @@ PHP_METHOD(SimpleXMLElement, xpath)
|
|||
result = retval->nodesetval;
|
||||
|
||||
if (result != NULL) {
|
||||
array_init(return_value);
|
||||
array_init_size(return_value, result->nodeNr);
|
||||
zend_hash_real_init_packed(Z_ARRVAL_P(return_value));
|
||||
|
||||
for (i = 0; i < result->nodeNr; ++i) {
|
||||
nodeptr = result->nodeTab[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue