Skip to content

Commit 42d3603

Browse files
committed
valueflow.cpp: avoid unnecessary copies in valueFlowFunctionReturn()
1 parent a7dd9f6 commit 42d3603

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/valueflow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5910,10 +5910,10 @@ static void valueFlowFunctionReturn(TokenList& tokenlist, ErrorLogger& errorLogg
59105910

59115911
bool hasKnownValue = false;
59125912

5913-
for (const ValueFlow::Value& v : getCommonValuesFromTokens(returns)) {
5914-
setFunctionReturnValue(function, tok, v, settings, false);
5913+
for (ValueFlow::Value& v : getCommonValuesFromTokens(returns)) {
59155914
if (v.isKnown())
59165915
hasKnownValue = true;
5916+
setFunctionReturnValue(function, tok, std::move(v), settings, false);
59175917
}
59185918

59195919
if (hasKnownValue)

0 commit comments

Comments
 (0)