From 4126fab1d525e1bdc7648444c44cc5904df08e09 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Tue, 12 Sep 2017 07:46:38 +0300 Subject: [PATCH] Simplify code with temporary --- lib/valueflow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 4336d2433..1c08b671d 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -1247,8 +1247,9 @@ static void valueFlowAST(Token *tok, unsigned int varid, const ValueFlow::Value if (conditionIsFalse(tok->astOperand1(), pm)) return; } else if (tok->str() == "||" && tok->astOperand1()) { + const std::list &values = tok->astOperand1()->values(); bool nonzero = false; - for (std::list::const_iterator it = tok->astOperand1()->values().begin(); it != tok->astOperand1()->values().end(); ++it) { + for (std::list::const_iterator it = values.begin(); it != values.end(); ++it) { nonzero |= (it->intvalue != 0); } if (!nonzero)