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); }