Merge pull request #246 from Dmitry-Me/moveVariableDeclaration

Move variable declaration closer to where it's needed
This commit is contained in:
Lee Thomason 2014-12-23 13:12:38 -08:00
commit ffee345723
2 changed files with 2 additions and 2 deletions

View File

@ -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 ) {

View File

@ -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;