mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Don't use a heap allocation to track the current item
This commit is contained in:
parent
6de0486e19
commit
aa19461151
1 changed files with 6 additions and 10 deletions
|
@ -76,19 +76,15 @@ xmlNodePtr create_notation(const xmlChar *name, const xmlChar *ExternalID, const
|
|||
|
||||
xmlNode *php_dom_libxml_hash_iter(xmlHashTable *ht, int index) /* {{{ */
|
||||
{
|
||||
xmlNode *nodep = NULL;
|
||||
nodeIterator *iter;
|
||||
int htsize;
|
||||
|
||||
if ((htsize = xmlHashSize(ht)) > 0 && index < htsize) {
|
||||
iter = emalloc(sizeof(nodeIterator));
|
||||
iter->cur = 0;
|
||||
iter->index = index;
|
||||
iter->node = NULL;
|
||||
xmlHashScan(ht, itemHashScanner, iter);
|
||||
nodep = iter->node;
|
||||
efree(iter);
|
||||
return nodep;
|
||||
nodeIterator iter;
|
||||
iter.cur = 0;
|
||||
iter.index = index;
|
||||
iter.node = NULL;
|
||||
xmlHashScan(ht, itemHashScanner, &iter);
|
||||
return iter.node;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue