Optimisation: Optimised firstWordEquals
This commit is contained in:
parent
5a8181d425
commit
1d79c164c4
|
@ -296,11 +296,13 @@ bool Token::simpleMatch(const Token *tok, const char pattern[])
|
||||||
int Token::firstWordEquals(const char *str, const char *word)
|
int Token::firstWordEquals(const char *str, const char *word)
|
||||||
{
|
{
|
||||||
for (;;)
|
for (;;)
|
||||||
|
{
|
||||||
|
if (*str != *word)
|
||||||
{
|
{
|
||||||
if (*str == ' ' && *word == 0)
|
if (*str == ' ' && *word == 0)
|
||||||
return 0;
|
return 0;
|
||||||
else if (*str != *word)
|
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
else if (*str == 0)
|
else if (*str == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue