Combine overlapping patterns
This commit is contained in:
parent
b9c2a996bf
commit
123f9b67e0
|
@ -4358,8 +4358,7 @@ bool Tokenizer::removeRedundantConditions()
|
||||||
void Tokenizer::removeRedundantFor()
|
void Tokenizer::removeRedundantFor()
|
||||||
{
|
{
|
||||||
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
||||||
if (Token::Match(tok, "[;{}] for ( %name% = %num% ; %name% < %num% ; ++| %name% ++| ) {") ||
|
if (Token::Match(tok, "[;{}] for ( %type%| %name% = %num% ; %name% < %num% ; ++| %name% ++| ) {")) {
|
||||||
Token::Match(tok, "[;{}] for ( %type% %name% = %num% ; %name% < %num% ; ++| %name% ++| ) {")) {
|
|
||||||
// Same variable name..
|
// Same variable name..
|
||||||
const Token* varTok = tok->tokAt(3);
|
const Token* varTok = tok->tokAt(3);
|
||||||
bool type = varTok->next()->isName();
|
bool type = varTok->next()->isName();
|
||||||
|
|
Loading…
Reference in New Issue