From 0582572867e44b6274a9ac01680aa1a2e1514a4b Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Sat, 29 Aug 2009 20:11:47 +0700 Subject: [PATCH] Tokenizer(simplifyNot): replace "if" by "else if" and added braces. No functional change. --- src/tokenize.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 9aef5756e..722a53433 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -2833,11 +2833,17 @@ bool Tokenizer::simplifyNot() for (Token *tok = _tokens; tok; tok = tok->next()) { if (Token::Match(tok, "if|while ( not %var%")) + { tok->tokAt(2)->str("!"); - if (Token::Match(tok, "&& not %var%")) + } + else if (Token::Match(tok, "&& not %var%")) + { tok->next()->str("!"); - if (Token::Match(tok, "|| not %var%")) + } + else if (Token::Match(tok, "|| not %var%")) + { tok->next()->str("!"); + } } return ret; }