Skip to content

Commit e3b7f10

Browse files
committed
Merge bitcoin/bitcoin#25237: rpc: Capture UniValue by ref for rpcdoccheck
20ff499 rpc: Capture potentially large UniValue by ref for rpcdoccheck (Martin Zumsande) Pull request description: Capturing it by reference instead of value should save us from making a copy of a potentially large object. Saw this while having a look at #25229 although I couldn't reproduce an actual leak, so this is not a fix for that issue. ACKs for top commit: MarcoFalke: review ACK 20ff499 theStack: Code-review ACK 20ff499 furszy: Code ACK 20ff499 Tree-SHA512: faf7bb14e37f8324b93a39095b07693626329da47c4a1ac8929bf99385e2e0567008e959e7e8540bc7d454d08fa41cccd39f55253c9a839fa88362922058a93b
2 parents b6ab45a + 20ff499 commit e3b7f10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rpc/util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ UniValue RPCHelpMan::HandleRequest(const JSONRPCRequest& request) const
583583
}
584584
const UniValue ret = m_fun(*this, request);
585585
if (gArgs.GetBoolArg("-rpcdoccheck", DEFAULT_RPC_DOC_CHECK)) {
586-
CHECK_NONFATAL(std::any_of(m_results.m_results.begin(), m_results.m_results.end(), [ret](const RPCResult& res) { return res.MatchesType(ret); }));
586+
CHECK_NONFATAL(std::any_of(m_results.m_results.begin(), m_results.m_results.end(), [&ret](const RPCResult& res) { return res.MatchesType(ret); }));
587587
}
588588
return ret;
589589
}

0 commit comments

Comments
 (0)