From 46d24c7bfb60955042ee34f2b682dea355f4e0a6 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Tue, 2 Sep 2014 19:51:22 +0400 Subject: [PATCH] Reduce patterns duplication --- lib/checkother.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 16adc5de2..ebbbc1537 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -433,14 +433,12 @@ void CheckOther::invalidPointerCast() const Token* toTok = 0; const Token* nextTok = 0; // Find cast - if (Token::Match(tok, "( const| %type% const| * )") || - Token::Match(tok, "( const| %type% %type% const| * )")) { + if (Token::Match(tok, "( const| %type% %type%| const| * )")) { toTok = tok->next(); nextTok = tok->link()->next(); if (nextTok && nextTok->str() == "(") nextTok = nextTok->next(); - } else if (Token::Match(tok, "reinterpret_cast < const| %type% const| * > (") || - Token::Match(tok, "reinterpret_cast < const| %type% %type% const| * > (")) { + } else if (Token::Match(tok, "reinterpret_cast < const| %type% %type%| const| * > (")) { nextTok = tok->tokAt(5); while (nextTok->str() != "(") nextTok = nextTok->next();