From 47f64df8aaa9c226a92a55bb8401395234d3be76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 9 Sep 2015 10:08:37 +0200 Subject: [PATCH] minor refactoring --- lib/checkautovariables.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/checkautovariables.cpp b/lib/checkautovariables.cpp index 883b58b84..5e1d7e03b 100644 --- a/lib/checkautovariables.cpp +++ b/lib/checkautovariables.cpp @@ -166,21 +166,17 @@ void CheckAutoVariables::autoVariables() errorAutoVariableAssignment(tok->next(), false); } else if (Token::Match(tok, "[;{}] %var% . %var% = & %var%")) { // TODO: check if the parameter is only changed temporarily (#2969) - if (printInconclusive) { - if (isPtrArg(tok->next())) { - const Token * const var2tok = tok->tokAt(6); - if (isAutoVar(var2tok) && checkRvalueExpression(var2tok)) - errorAutoVariableAssignment(tok->next(), true); - } + if (printInconclusive && isPtrArg(tok->next())) { + const Token * const var2tok = tok->tokAt(6); + if (isAutoVar(var2tok) && checkRvalueExpression(var2tok)) + errorAutoVariableAssignment(tok->next(), true); } tok = tok->tokAt(6); } else if (Token::Match(tok, "[;{}] %var% . %var% = %var% ;")) { // TODO: check if the parameter is only changed temporarily (#2969) - if (printInconclusive) { - if (isPtrArg(tok->next())) { - if (isAutoVarArray(tok->tokAt(5))) - errorAutoVariableAssignment(tok->next(), true); - } + if (printInconclusive && isPtrArg(tok->next())) { + if (isAutoVarArray(tok->tokAt(5))) + errorAutoVariableAssignment(tok->next(), true); } tok = tok->tokAt(5); } else if (Token::Match(tok, "[;{}] * %var% = %var% ;")) {