Merge pull request #248 from JayXon/simplifyParseName

Simplify ParseName
This commit is contained in:
Lee Thomason 2014-12-26 16:18:46 -08:00
commit 5f06297230
1 changed files with 7 additions and 7 deletions

View File

@ -140,18 +140,18 @@ char* StrPair::ParseName( char* p )
if ( !p || !(*p) ) {
return 0;
}
if ( !XMLUtil::IsNameStartChar( *p ) ) {
return 0;
}
char* const start = p;
while( *p && ( p == start ? XMLUtil::IsNameStartChar( *p ) : XMLUtil::IsNameChar( *p ) )) {
++p;
while ( *p && XMLUtil::IsNameChar( *p ) ) {
++p;
}
if ( p > start ) {
Set( start, p, 0 );
return p;
}
return 0;
Set( start, p, 0 );
return p;
}