Skip to content

Commit ed18ac6

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

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

58585858
bool hasKnownValue = false;
58595859

5860-
for (const ValueFlow::Value& v : getCommonValuesFromTokens(returns)) {
5861-
setFunctionReturnValue(function, tok, v, settings, false);
5860+
for (ValueFlow::Value& v : getCommonValuesFromTokens(returns)) {
58625861
if (v.isKnown())
58635862
hasKnownValue = true;
5863+
setFunctionReturnValue(function, tok, std::move(v), settings, false);
58645864
}
58655865

58665866
if (hasKnownValue)

0 commit comments

Comments
 (0)