Skip to content

Commit 0fee720

Browse files
committed
Simplify node check in simplexml
1 parent 7c4db15 commit 0fee720

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/simplexml/simplexml.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -979,8 +979,8 @@ static int sxe_prop_is_empty(zend_object *object) /* {{{ */
979979
if (sxe->iter.type == SXE_ITER_ELEMENT) {
980980
node = php_sxe_get_first_node(sxe, node);
981981
}
982-
if (!node || node->type != XML_ENTITY_DECL) {
983-
attr = node ? (xmlAttrPtr)node->properties : NULL;
982+
if (node && node->type != XML_ENTITY_DECL) {
983+
attr = node->properties;
984984
test = sxe->iter.name && sxe->iter.type == SXE_ITER_ATTRLIST;
985985
while (attr) {
986986
if ((!test || xmlStrEqual(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr)attr, sxe->iter.nsprefix, sxe->iter.isprefix)) {
@@ -1088,8 +1088,8 @@ static HashTable *sxe_get_prop_hash(zend_object *object, int is_debug) /* {{{ */
10881088
if (sxe->iter.type == SXE_ITER_ELEMENT) {
10891089
node = php_sxe_get_first_node(sxe, node);
10901090
}
1091-
if (!node || node->type != XML_ENTITY_DECL) {
1092-
attr = node ? (xmlAttrPtr)node->properties : NULL;
1091+
if (node && node->type != XML_ENTITY_DECL) {
1092+
attr = node->properties;
10931093
ZVAL_UNDEF(&zattr);
10941094
test = sxe->iter.name && sxe->iter.type == SXE_ITER_ATTRLIST;
10951095
while (attr) {

0 commit comments

Comments
 (0)