From 0fa225ecb5dac778b4e9fbead023a5894363a000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 9 Feb 2021 21:47:56 +0100 Subject: [PATCH] Fix Cppcheck warning; useStlAlgorithm --- lib/checkclass.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index db01b8073..a1352f6cc 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -2843,9 +2843,9 @@ Check::FileInfo *CheckClass::getFileInfo(const Tokenizer *tokenizer, const Setti std::vector classDefinitions; for (const Scope * classScope : tokenizer->getSymbolDatabase()->classAndStructScopes) { // the full definition must be compared - bool fullDefinition = true; - for (const Function &f: classScope->functionList) - fullDefinition &= f.hasBody(); + bool fullDefinition = std::all_of(classScope->functionList.begin(), + classScope->functionList.end(), + [](const Function& f) { return f.hasBody(); }); if (!fullDefinition) continue;