From 6d202ff20eb00eb1c0ad9634f91b9c45a278fde4 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Fri, 26 Sep 2014 14:21:00 +0400 Subject: [PATCH] Eliminate repeated virtual calls --- tinyxml2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 0e1386d..9688e5d 100755 --- a/tinyxml2.cpp +++ b/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() ) ); }