mirror of https://github.com/AxioDL/tinyxml2.git
Merge pull request #246 from Dmitry-Me/moveVariableDeclaration
Move variable declaration closer to where it's needed
This commit is contained in:
commit
ffee345723
|
@ -1861,7 +1861,6 @@ XMLError XMLDocument::SaveFile( FILE* fp, bool compact )
|
|||
|
||||
XMLError XMLDocument::Parse( const char* p, size_t len )
|
||||
{
|
||||
const char* start = p;
|
||||
Clear();
|
||||
|
||||
if ( len == 0 || !p || !*p ) {
|
||||
|
@ -1875,6 +1874,7 @@ XMLError XMLDocument::Parse( const char* p, size_t len )
|
|||
memcpy( _charBuffer, p, len );
|
||||
_charBuffer[len] = 0;
|
||||
|
||||
const char* start = p;
|
||||
p = XMLUtil::SkipWhiteSpace( p );
|
||||
p = XMLUtil::ReadBOM( p, &_writeBOM );
|
||||
if ( !p || !*p ) {
|
||||
|
|
|
@ -562,10 +562,10 @@ public:
|
|||
}
|
||||
|
||||
inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX ) {
|
||||
int n = 0;
|
||||
if ( p == q ) {
|
||||
return true;
|
||||
}
|
||||
int n = 0;
|
||||
while( *p && *q && *p == *q && n<nChar ) {
|
||||
++p;
|
||||
++q;
|
||||
|
|
Loading…
Reference in New Issue