Tokenizer::combineOperators: prevent duplicate checking of same condition

This commit is contained in:
Matthias Krüger 2015-08-09 14:23:26 +02:00
parent 66676b8e55
commit 4e4a1cfe3a
1 changed files with 9 additions and 13 deletions

View File

@ -1911,19 +1911,15 @@ void Tokenizer::combineOperators()
tok->deleteNext(); tok->deleteNext();
continue; continue;
} }
} } else if (tok->next()->str() == "=") {
if (tok->str() == ">>") {
else if (tok->str() == ">>" && tok->next()->str() == "=") {
tok->str(">>="); tok->str(">>=");
tok->deleteNext(); tok->deleteNext();
} } else if (tok->str() == "<<") {
else if (tok->str() == "<<" && tok->next()->str() == "=") {
tok->str("<<="); tok->str("<<=");
tok->deleteNext(); tok->deleteNext();
} }
} else if ((c1 == 'p' || c1 == '_') && tok->next()->str() == ":" && tok->strAt(2) != ":") {
else if ((c1 == 'p' || c1 == '_') && tok->next()->str() == ":" && tok->strAt(2) != ":") {
if (Token::Match(tok, "private|protected|public|__published")) { if (Token::Match(tok, "private|protected|public|__published")) {
tok->str(tok->str() + ":"); tok->str(tok->str() + ":");
tok->deleteNext(); tok->deleteNext();