From c0fb0bf1b0017d006e8a9b09b53885a5284a7bc4 Mon Sep 17 00:00:00 2001 From: chrchr Date: Mon, 26 Jun 2023 15:55:31 +0200 Subject: [PATCH] Use compare() --- lib/checkunusedvar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkunusedvar.cpp b/lib/checkunusedvar.cpp index 4cadd9c332d..41a2538f466 100644 --- a/lib/checkunusedvar.cpp +++ b/lib/checkunusedvar.cpp @@ -1269,7 +1269,7 @@ void CheckUnusedVar::checkFunctionVariableUsage() (!op1Var->valueType() || op1Var->valueType()->type == ValueType::Type::UNKNOWN_TYPE)) { // Check in the library if we should bailout or not.. std::string typeName = op1Var->getTypeName(); - if (typeName.find("::") == 0) + if (typeName.compare(0, 2, "::") == 0) typeName.erase(typeName.begin(), typeName.begin() + 2); switch (mSettings->library.getTypeCheck("unusedvar", typeName)) { case Library::TypeCheck::def: