mirror of https://github.com/AxioDL/tinyxml2.git
Merge pull request #248 from JayXon/simplifyParseName
Simplify ParseName
This commit is contained in:
commit
5f06297230
14
tinyxml2.cpp
14
tinyxml2.cpp
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue