From 0cc5b67bf65f918f96da87984c16f45926c6fee2 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Wed, 24 Sep 2014 13:22:05 +0200 Subject: [PATCH] Avoid copying std::list object in valueFlowAfterAssign --- lib/valueflow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 03cd77f71..e8a1b5f77 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -978,8 +978,8 @@ static void valueFlowAfterAssign(TokenList *tokenlist, ErrorLogger *errorLogger, // Rhs values.. if (!tok->astOperand2() || tok->astOperand2()->values.empty()) continue; - std::list values = tok->astOperand2()->values; + const std::list& values = tok->astOperand2()->values; const bool constValue = tok->astOperand2()->isNumber(); valueFlowForward(tok, endOfVarScope, var, varid, values, constValue, tokenlist, errorLogger, settings); }