1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Small optimization in php_sxe_get_first_node() by avoiding unwrapping iterator data (#12194)

This commit is contained in:
Niels Dossche
2023-09-13 22:47:09 +02:00
committed by GitHub
parent df0aca320c
commit 05c46b71d4

View File

@@ -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;
}