Merge pull request #215 from Dmitry-Me/duplicateVirtualCalls2

Remove unneeded virtual calls
This commit is contained in:
Lee Thomason 2014-09-29 16:19:00 -07:00
commit 0895e78549
1 changed files with 6 additions and 6 deletions

View File

@ -1257,7 +1257,7 @@ const char* XMLElement::Attribute( const char* name, const char* value ) const
const char* XMLElement::GetText() const const char* XMLElement::GetText() const
{ {
if ( FirstChild() && FirstChild()->ToText() ) { if ( FirstChild() && FirstChild()->ToText() ) {
return FirstChild()->ToText()->Value(); return FirstChild()->Value();
} }
return 0; return 0;
} }
@ -1317,7 +1317,7 @@ void XMLElement::SetText( double v )
XMLError XMLElement::QueryIntText( int* ival ) const XMLError XMLElement::QueryIntText( int* ival ) const
{ {
if ( FirstChild() && FirstChild()->ToText() ) { if ( FirstChild() && FirstChild()->ToText() ) {
const char* t = FirstChild()->ToText()->Value(); const char* t = FirstChild()->Value();
if ( XMLUtil::ToInt( t, ival ) ) { if ( XMLUtil::ToInt( t, ival ) ) {
return XML_SUCCESS; return XML_SUCCESS;
} }
@ -1330,7 +1330,7 @@ XMLError XMLElement::QueryIntText( int* ival ) const
XMLError XMLElement::QueryUnsignedText( unsigned* uval ) const XMLError XMLElement::QueryUnsignedText( unsigned* uval ) const
{ {
if ( FirstChild() && FirstChild()->ToText() ) { if ( FirstChild() && FirstChild()->ToText() ) {
const char* t = FirstChild()->ToText()->Value(); const char* t = FirstChild()->Value();
if ( XMLUtil::ToUnsigned( t, uval ) ) { if ( XMLUtil::ToUnsigned( t, uval ) ) {
return XML_SUCCESS; return XML_SUCCESS;
} }
@ -1343,7 +1343,7 @@ XMLError XMLElement::QueryUnsignedText( unsigned* uval ) const
XMLError XMLElement::QueryBoolText( bool* bval ) const XMLError XMLElement::QueryBoolText( bool* bval ) const
{ {
if ( FirstChild() && FirstChild()->ToText() ) { if ( FirstChild() && FirstChild()->ToText() ) {
const char* t = FirstChild()->ToText()->Value(); const char* t = FirstChild()->Value();
if ( XMLUtil::ToBool( t, bval ) ) { if ( XMLUtil::ToBool( t, bval ) ) {
return XML_SUCCESS; return XML_SUCCESS;
} }
@ -1356,7 +1356,7 @@ XMLError XMLElement::QueryBoolText( bool* bval ) const
XMLError XMLElement::QueryDoubleText( double* dval ) const XMLError XMLElement::QueryDoubleText( double* dval ) const
{ {
if ( FirstChild() && FirstChild()->ToText() ) { if ( FirstChild() && FirstChild()->ToText() ) {
const char* t = FirstChild()->ToText()->Value(); const char* t = FirstChild()->Value();
if ( XMLUtil::ToDouble( t, dval ) ) { if ( XMLUtil::ToDouble( t, dval ) ) {
return XML_SUCCESS; return XML_SUCCESS;
} }
@ -1369,7 +1369,7 @@ XMLError XMLElement::QueryDoubleText( double* dval ) const
XMLError XMLElement::QueryFloatText( float* fval ) const XMLError XMLElement::QueryFloatText( float* fval ) const
{ {
if ( FirstChild() && FirstChild()->ToText() ) { if ( FirstChild() && FirstChild()->ToText() ) {
const char* t = FirstChild()->ToText()->Value(); const char* t = FirstChild()->Value();
if ( XMLUtil::ToFloat( t, fval ) ) { if ( XMLUtil::ToFloat( t, fval ) ) {
return XML_SUCCESS; return XML_SUCCESS;
} }