From 44ba0ca347c7fffab58f77a31350fa48730b719a Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Wed, 27 Aug 2014 11:32:14 +0400 Subject: [PATCH] Continue early to omit unneeded operations --- lib/checkstl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index 3a3360973..119cbf1d5 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -550,11 +550,12 @@ void CheckStl::pushback() if (Token::Match(tok, "%var% = & %var% [")) { // Variable id for pointer const unsigned int pointerId(tok->varId()); + if( pointerId == 0 ) + continue; // Variable id for the container variable const unsigned int containerId(tok->tokAt(3)->varId()); - - if (pointerId == 0 || containerId == 0) + if (containerId == 0) continue; bool invalidPointer = false;