mirror of https://github.com/AxioDL/tinyxml2.git
Merge pull request #268 from Dmitry-Me/avoidRepeatedComparisons
Get rid of repeated comparisons
This commit is contained in:
commit
f802660f7d
10
tinyxml2.cpp
10
tinyxml2.cpp
|
@ -866,14 +866,16 @@ char* XMLNode::ParseDeep( char* p, StrPair* parentEnd )
|
||||||
// Handle an end tag returned to this level.
|
// Handle an end tag returned to this level.
|
||||||
// And handle a bunch of annoying errors.
|
// And handle a bunch of annoying errors.
|
||||||
bool mismatch = false;
|
bool mismatch = false;
|
||||||
if ( endTag.Empty() && ele->ClosingType() == XMLElement::OPEN ) {
|
if ( endTag.Empty() ) {
|
||||||
|
if ( ele->ClosingType() == XMLElement::OPEN ) {
|
||||||
mismatch = true;
|
mismatch = true;
|
||||||
}
|
}
|
||||||
else if ( !endTag.Empty() && ele->ClosingType() != XMLElement::OPEN ) {
|
}
|
||||||
|
else {
|
||||||
|
if ( ele->ClosingType() != XMLElement::OPEN ) {
|
||||||
mismatch = true;
|
mismatch = true;
|
||||||
}
|
}
|
||||||
else if ( !endTag.Empty() ) {
|
else if ( !XMLUtil::StringEqual( endTag.GetStr(), node->Value() ) ) {
|
||||||
if ( !XMLUtil::StringEqual( endTag.GetStr(), node->Value() )) {
|
|
||||||
mismatch = true;
|
mismatch = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue