瀏覽代碼

Merge pull request #214 from Dmitry-Me/duplicateVirtualCalls

Eliminate repeated virtual calls
Lee Thomason 11 年之前
父節點
當前提交
f2496f5824
共有 1 個文件被更改,包括 2 次插入1 次删除
  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() ) );
 }