mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Small optimization in php_sxe_get_first_node() by avoiding unwrapping iterator data (#12194)
This commit is contained in:
parent
df0aca320c
commit
05c46b71d4
1 changed files with 1 additions and 9 deletions
|
@ -78,16 +78,8 @@ static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE
|
|||
|
||||
static xmlNodePtr php_sxe_get_first_node(php_sxe_object *sxe, xmlNodePtr node) /* {{{ */
|
||||
{
|
||||
php_sxe_object *intern;
|
||||
xmlNodePtr retnode = NULL;
|
||||
|
||||
if (sxe && sxe->iter.type != SXE_ITER_NONE) {
|
||||
php_sxe_reset_iterator(sxe, 1);
|
||||
if (!Z_ISUNDEF(sxe->iter.data)) {
|
||||
intern = Z_SXEOBJ_P(&sxe->iter.data);
|
||||
GET_NODE(intern, retnode)
|
||||
}
|
||||
return retnode;
|
||||
return php_sxe_reset_iterator(sxe, 1);
|
||||
} else {
|
||||
return node;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue