Merge pull request #268 from Dmitry-Me/avoidRepeatedComparisons

Get rid of repeated comparisons
This commit is contained in:
Lee Thomason 2015-01-09 16:56:40 -08:00
commit f802660f7d
1 changed files with 9 additions and 7 deletions

View File

@ -866,14 +866,16 @@ char* XMLNode::ParseDeep( char* p, StrPair* parentEnd )
// Handle an end tag returned to this level.
// And handle a bunch of annoying errors.
bool mismatch = false;
if ( endTag.Empty() && ele->ClosingType() == XMLElement::OPEN ) {
if ( endTag.Empty() ) {
if ( ele->ClosingType() == XMLElement::OPEN ) {
mismatch = true;
}
else if ( !endTag.Empty() && ele->ClosingType() != XMLElement::OPEN ) {
}
else {
if ( ele->ClosingType() != XMLElement::OPEN ) {
mismatch = true;
}
else if ( !endTag.Empty() ) {
if ( !XMLUtil::StringEqual( endTag.GetStr(), node->Value() )) {
else if ( !XMLUtil::StringEqual( endTag.GetStr(), node->Value() ) ) {
mismatch = true;
}
}