From 123f9b67e0dbae67555a3242181edada1633af7f Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Sat, 26 Aug 2017 07:32:02 +0300 Subject: [PATCH] Combine overlapping patterns --- lib/tokenize.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index dabeaa150..56c77a724 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -4358,8 +4358,7 @@ bool Tokenizer::removeRedundantConditions() void Tokenizer::removeRedundantFor() { for (Token *tok = list.front(); tok; tok = tok->next()) { - if (Token::Match(tok, "[;{}] for ( %name% = %num% ; %name% < %num% ; ++| %name% ++| ) {") || - Token::Match(tok, "[;{}] for ( %type% %name% = %num% ; %name% < %num% ; ++| %name% ++| ) {")) { + if (Token::Match(tok, "[;{}] for ( %type%| %name% = %num% ; %name% < %num% ; ++| %name% ++| ) {")) { // Same variable name.. const Token* varTok = tok->tokAt(3); bool type = varTok->next()->isName();