Skip to content

Commit cb30d60

Browse files
committed
valueflow.cpp: avoid unnecessary copies in valueFlowFunctionReturn()
1 parent 347823d commit cb30d60

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
@@ -5960,10 +5960,10 @@ static void valueFlowFunctionReturn(TokenList& tokenlist, ErrorLogger& errorLogg
59605960

59615961
bool hasKnownValue = false;
59625962

5963-
for (const ValueFlow::Value& v : getCommonValuesFromTokens(returns)) {
5964-
setFunctionReturnValue(function, tok, v, settings, false);
5963+
for (ValueFlow::Value& v : getCommonValuesFromTokens(returns)) {
59655964
if (v.isKnown())
59665965
hasKnownValue = true;
5966+
setFunctionReturnValue(function, tok, std::move(v), settings, false);
59675967
}
59685968

59695969
if (hasKnownValue)

0 commit comments

Comments
 (0)