From 502ba953831fa312a2c81f95c59ad5da4df4485e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 28 Mar 2014 18:21:56 +0100 Subject: [PATCH] Simplification. Code 'else if ..' is simplified to 'else { if ..' --- lib/checkother.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 25a181e76..24a4ea31d 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -2546,10 +2546,8 @@ void CheckOther::checkDuplicateIf() const Token *tok1 = scope->classEnd; // check all the else if (...) statements - while ((Token::simpleMatch(tok1, "} else if (") && - Token::simpleMatch(tok1->linkAt(3), ") {")) || - (Token::simpleMatch(tok1, "} else { if (") && - Token::simpleMatch(tok1->linkAt(4), ") {"))) { + while (Token::simpleMatch(tok1, "} else { if (") && + Token::simpleMatch(tok1->linkAt(4), ") {")) { int conditionIndex=(tok1->strAt(3)=="(") ? 3 : 4; // get the expression from the token stream expression = tok1->tokAt(conditionIndex+1)->stringifyList(tok1->linkAt(conditionIndex));