From f97015e244e9710ce40d1d257585c5d18f124dd4 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Tue, 22 Jan 2013 13:16:23 +0100 Subject: [PATCH] Don't use Token::Match() for simple string comparison --- lib/checknullpointer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checknullpointer.cpp b/lib/checknullpointer.cpp index 5a96947f2..bbaeacafe 100644 --- a/lib/checknullpointer.cpp +++ b/lib/checknullpointer.cpp @@ -404,7 +404,7 @@ bool CheckNullPointer::isPointerDeRef(const Token *tok, bool &unknown, const Sym return false; // OK to check pointer in "= p ? : " - if (Token::Match(tok->next(),"?") && + if (tok->next()->str() == "?" && (Token::Match(tok->previous(), "return|throw|;|{|}|:|[|(|,") || tok->previous()->isAssignmentOp())) return false;