mirror of https://github.com/AxioDL/tinyxml2.git
Merge pull request #215 from Dmitry-Me/duplicateVirtualCalls2
Remove unneeded virtual calls
This commit is contained in:
commit
0895e78549
12
tinyxml2.cpp
12
tinyxml2.cpp
|
@ -1257,7 +1257,7 @@ const char* XMLElement::Attribute( const char* name, const char* value ) const
|
|||
const char* XMLElement::GetText() const
|
||||
{
|
||||
if ( FirstChild() && FirstChild()->ToText() ) {
|
||||
return FirstChild()->ToText()->Value();
|
||||
return FirstChild()->Value();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1317,7 +1317,7 @@ void XMLElement::SetText( double v )
|
|||
XMLError XMLElement::QueryIntText( int* ival ) const
|
||||
{
|
||||
if ( FirstChild() && FirstChild()->ToText() ) {
|
||||
const char* t = FirstChild()->ToText()->Value();
|
||||
const char* t = FirstChild()->Value();
|
||||
if ( XMLUtil::ToInt( t, ival ) ) {
|
||||
return XML_SUCCESS;
|
||||
}
|
||||
|
@ -1330,7 +1330,7 @@ XMLError XMLElement::QueryIntText( int* ival ) const
|
|||
XMLError XMLElement::QueryUnsignedText( unsigned* uval ) const
|
||||
{
|
||||
if ( FirstChild() && FirstChild()->ToText() ) {
|
||||
const char* t = FirstChild()->ToText()->Value();
|
||||
const char* t = FirstChild()->Value();
|
||||
if ( XMLUtil::ToUnsigned( t, uval ) ) {
|
||||
return XML_SUCCESS;
|
||||
}
|
||||
|
@ -1343,7 +1343,7 @@ XMLError XMLElement::QueryUnsignedText( unsigned* uval ) const
|
|||
XMLError XMLElement::QueryBoolText( bool* bval ) const
|
||||
{
|
||||
if ( FirstChild() && FirstChild()->ToText() ) {
|
||||
const char* t = FirstChild()->ToText()->Value();
|
||||
const char* t = FirstChild()->Value();
|
||||
if ( XMLUtil::ToBool( t, bval ) ) {
|
||||
return XML_SUCCESS;
|
||||
}
|
||||
|
@ -1356,7 +1356,7 @@ XMLError XMLElement::QueryBoolText( bool* bval ) const
|
|||
XMLError XMLElement::QueryDoubleText( double* dval ) const
|
||||
{
|
||||
if ( FirstChild() && FirstChild()->ToText() ) {
|
||||
const char* t = FirstChild()->ToText()->Value();
|
||||
const char* t = FirstChild()->Value();
|
||||
if ( XMLUtil::ToDouble( t, dval ) ) {
|
||||
return XML_SUCCESS;
|
||||
}
|
||||
|
@ -1369,7 +1369,7 @@ XMLError XMLElement::QueryDoubleText( double* dval ) const
|
|||
XMLError XMLElement::QueryFloatText( float* fval ) const
|
||||
{
|
||||
if ( FirstChild() && FirstChild()->ToText() ) {
|
||||
const char* t = FirstChild()->ToText()->Value();
|
||||
const char* t = FirstChild()->Value();
|
||||
if ( XMLUtil::ToFloat( t, fval ) ) {
|
||||
return XML_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue