Skip to content

Commit

Permalink
removed unnecessary checks not detected by tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Nov 29, 2024
1 parent 16d250e commit 2ee9352
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/cppcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1103,8 +1103,8 @@ void CppCheck::checkNormalTokens(const Tokenizer &tokenizer)

if (mSettings.useSingleJob() || !mSettings.buildDir.empty()) {
// Analyse the tokens..

if (CTU::FileInfo * const fi1 = CTU::getFileInfo(tokenizer)) {
{
CTU::FileInfo * const fi1 = CTU::getFileInfo(tokenizer);
if (!mSettings.buildDir.empty())
mAnalyzerInformation.setFileInfo("ctu", fi1->toString());
if (mSettings.useSingleJob())
Expand Down
2 changes: 1 addition & 1 deletion lib/templatesimplifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ void TemplateSimplifier::simplifyTemplateAliases()
const Token * const fromStart = args[argnr].first;
const Token * const fromEnd = args[argnr].second->previous();
Token *temp = TokenList::copyTokens(tok1, fromStart, fromEnd, true);
const bool tempOK(temp && temp != tok1->next());
const bool tempOK(temp != tok1->next());
tok1->deleteThis();
if (tempOK)
tok1 = temp; // skip over inserted parameters
Expand Down
3 changes: 0 additions & 3 deletions lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2152,9 +2152,6 @@ void Tokenizer::simplifyTypedefCpp()

tok2 = TokenList::copyTokens(tok2, argStart, argEnd);
if (inTemplate) {
if (!tok2)
syntaxError(nullptr);

tok2 = tok2->next();
}

Expand Down

0 comments on commit 2ee9352

Please sign in to comment.