Skip to content

Commit 57fc369

Browse files
committed
valueflow.cpp: avoid unnecessary copies in valueFlowFunctionReturn() [skip ci]
1 parent df517c5 commit 57fc369

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

58165816
bool hasKnownValue = false;
58175817

5818-
for (const ValueFlow::Value& v : getCommonValuesFromTokens(returns)) {
5819-
setFunctionReturnValue(function, tok, v, settings, false);
5818+
for (ValueFlow::Value& v : getCommonValuesFromTokens(returns)) {
58205819
if (v.isKnown())
58215820
hasKnownValue = true;
5821+
setFunctionReturnValue(function, tok, std::move(v), settings, false);
58225822
}
58235823

58245824
if (hasKnownValue)

0 commit comments

Comments
 (0)