Skip to content

Commit 0d6add0

Browse files
committed
valueflow.cpp: avoid unnecessary copies in valueFlowFunctionReturn()
1 parent c9b4cb7 commit 0d6add0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/valueflow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5844,10 +5844,10 @@ static void valueFlowFunctionReturn(TokenList& tokenlist, ErrorLogger& errorLogg
58445844
if (programMemory.empty() && !arguments.empty())
58455845
continue;
58465846
std::vector<ValueFlow::Value> values = execute(function->functionScope, programMemory, settings);
5847-
for (const ValueFlow::Value& v : values) {
5847+
for (ValueFlow::Value& v : values) {
58485848
if (v.isUninitValue())
58495849
continue;
5850-
setFunctionReturnValue(function, tok, v, settings);
5850+
setFunctionReturnValue(function, tok, std::move(v), settings);
58515851
}
58525852
}
58535853
}

0 commit comments

Comments
 (0)