Explorar o código

Eliminate repeated virtual calls

Dmitry-Me %!s(int64=11) %!d(string=hai) anos
pai
achega
6d202ff20e
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      tinyxml2.cpp

+ 2 - 1
tinyxml2.cpp

@@ -913,7 +913,8 @@ XMLNode* XMLText::ShallowClone( XMLDocument* doc ) const
 
 bool XMLText::ShallowEqual( const XMLNode* compare ) const
 {
-    return ( compare->ToText() && XMLUtil::StringEqual( compare->ToText()->Value(), Value() ));
+    const XMLText* text = compare->ToText();
+    return ( text && XMLUtil::StringEqual( text->Value(), Value() ) );
 }