From 4d52949be6e00d4778f19f621e1adf059ba4b3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 13 Jul 2018 16:50:12 +0200 Subject: [PATCH] Refactoring: Use ranged for loop --- lib/checkpostfixoperator.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/checkpostfixoperator.cpp b/lib/checkpostfixoperator.cpp index 0c3d798e0..60c1d009d 100644 --- a/lib/checkpostfixoperator.cpp +++ b/lib/checkpostfixoperator.cpp @@ -50,9 +50,7 @@ void CheckPostfixOperator::postfixOperator() const SymbolDatabase *symbolDatabase = mTokenizer->getSymbolDatabase(); - const std::size_t functions = symbolDatabase->functionScopes.size(); - for (std::size_t i = 0; i < functions; ++i) { - const Scope * scope = symbolDatabase->functionScopes[i]; + for (const Scope * scope : symbolDatabase->functionScopes) { for (const Token* tok = scope->bodyStart->next(); tok != scope->bodyEnd; tok = tok->next()) { const Variable *var = tok->variable(); if (!var || !Token::Match(tok, "%var% ++|--"))