From dbfdd8fdd58c0359134ebdc2aeed333c5f5bd084 Mon Sep 17 00:00:00 2001 From: JayXon Date: Fri, 12 Dec 2014 20:07:14 -0500 Subject: [PATCH] Simplify node logic --- tinyxml2.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 77c1a8a..9ca1100 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -855,7 +855,6 @@ char* XMLNode::ParseDeep( char* p, StrPair* parentEnd ) p = node->ParseDeep( p, &endTag ); if ( !p ) { DeleteNode( node ); - node = 0; if ( !_document->Error() ) { _document->SetError( XML_ERROR_PARSING, 0, 0 ); } @@ -890,16 +889,11 @@ char* XMLNode::ParseDeep( char* p, StrPair* parentEnd ) } if ( mismatch ) { _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, node->Value(), 0 ); - p = 0; + DeleteNode( node ); + break; } } - if ( p == 0 ) { - DeleteNode( node ); - node = 0; - } - if ( node ) { - this->InsertEndChild( node ); - } + InsertEndChild( node ); } return 0; }