From 02b714f6dcfbc29e6d5d8d15308e2e59e8dcf248 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Mon, 4 Jan 2021 13:09:05 +0100 Subject: [PATCH] Code formatting [ci skip] --- lib/checkstl.cpp | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index 95df25af1..bc2237a1a 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -1640,37 +1640,27 @@ void CheckStl::missingComparison() bool bComparedInAdvance = false; // Parse loop.. - for (const Token *tok3 = scope.bodyStart; tok3 != scope.bodyEnd; tok3 = tok3->next()) - { - if (tok3->varId() == iteratorId) - { - if (Token::Match(tok3, "%varid% = %name% . insert ( ++| %varid% ++| ,", iteratorId)) - { + for (const Token *tok3 = scope.bodyStart; tok3 != scope.bodyEnd; tok3 = tok3->next()) { + if (tok3->varId() == iteratorId) { + if (Token::Match(tok3, "%varid% = %name% . insert ( ++| %varid% ++| ,", iteratorId)) { // skip insertion.. tok3 = tok3->linkAt(6); if (!tok3) break; - } - else if (Token::simpleMatch(tok3->astParent(), "++")) - { + } else if (Token::simpleMatch(tok3->astParent(), "++")) { if (!bComparedInAdvance) incrementToken = tok3; else bComparedInAdvance = false; - } - else if (Token::simpleMatch(tok3->astParent(), "+")) - { - if (Token::simpleMatch(tok3->astSibling(), "1")) - { + } else if (Token::simpleMatch(tok3->astParent(), "+")) { + if (Token::simpleMatch(tok3->astSibling(), "1")) { const Token* tokenGrandParent = tok3->astParent()->astParent(); if (Token::Match(tokenGrandParent, "==|!=")) bComparedInAdvance = true; } - } - else if (Token::Match(tok3->astParent(), "==|!=")) + } else if (Token::Match(tok3->astParent(), "==|!=")) incrementToken = nullptr; - } - else if (tok3->str() == "break" || tok3->str() == "return") + } else if (tok3->str() == "break" || tok3->str() == "return") incrementToken = nullptr; } if (incrementToken)