Skip to content

Commit 4f3a25d

Browse files
committed
fixed redundantNextPrevious
1 parent 72a9b13 commit 4f3a25d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/checkleakautovar.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,11 @@ static const Token * isAnonymousFunctionCall(const Token * tok)
291291
// the lpar surrounding x has isCast() == true, so checking isCast() would
292292
// have false positive leaks, while allowing casts to take ownership of
293293
// resources is instead a false negative
294-
if (tok->previous()->str() == "(" && !tok->previous()->isBinaryOp() &&
294+
if (tok->strAt(-1) == "(" && !tok->previous()->isBinaryOp() &&
295295
tok->linkAt(-1) && !tok->isStandardType()) {
296296
tok = tok->linkAt(-1)->next();
297-
} else if (!tok->isStandardType() && tok->isName() && tok->next()->str() == "(") {
297+
} else if (!tok->isStandardType() && tok->isName() &&
298+
tok->strAt(1) == "(") {
298299
tok = tok->linkAt(1)->next();
299300
} else {
300301
return nullptr;

0 commit comments

Comments
 (0)