diff --git a/lib/checkmemoryleak.h b/lib/checkmemoryleak.h index 93b4a0f7d..b69f52662 100644 --- a/lib/checkmemoryleak.h +++ b/lib/checkmemoryleak.h @@ -196,10 +196,8 @@ public: /** @brief run all simplified checks */ void runSimplifiedChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) { // Don't use these check for Java and C# programs.. - if (tokenizr->getFiles()->at(0).find(".java") != std::string::npos || - tokenizr->getFiles()->at(0).find(".cs") != std::string::npos) { + if (tokenizr->isJavaOrCSharp()) return; - } CheckMemoryLeakInFunction checkMemoryLeak(tokenizr, settings, errLog); checkMemoryLeak.checkReallocUsage(); @@ -367,10 +365,8 @@ public: void runSimplifiedChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) { // Don't use these check for Java and C# programs.. - if (tokenizr->getFiles()->at(0).find(".java") != std::string::npos || - tokenizr->getFiles()->at(0).find(".cs") != std::string::npos) { + if (tokenizr->isJavaOrCSharp()) return; - } CheckMemoryLeakInClass checkMemoryLeak(tokenizr, settings, errLog); checkMemoryLeak.check();