From 59e361b91795b5005a13d8477019b7c271b5562f Mon Sep 17 00:00:00 2001 From: Goncalo Mao-Cheia Date: Wed, 29 Oct 2025 00:20:04 +0000 Subject: [PATCH] Small refactoring in CppCheck::check return logic --- lib/cppcheck.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 9c411a8b0af..454b617e188 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -784,16 +784,9 @@ unsigned int CppCheck::check(const FileWithDetails &file) ErrorMessage msg({}, file.spath(), Severity::information, "", "", Certainty::normal); (void)mSuppressions.nomsg.isSuppressed(SuppressionList::ErrorMessage::fromErrorMessage(msg, {}), true); } - - unsigned int returnValue; - if (mSettings.clang) - returnValue = checkClang(file, 0); - else - returnValue = checkFile(file, "", 0); - // TODO: call analyseClangTidy() - return returnValue; + return mSettings.clang ? checkClang(file, 0) : checkFile(file, "", 0); } unsigned int CppCheck::checkBuffer(const FileWithDetails &file, const uint8_t* data, std::size_t size)