trivial: avoid unneeded copy when iterating through mapDenomCount

Caught by Clang 14 with `--enable-werror`
This commit is contained in:
Kittywhiskers Van Gogh 2024-09-13 13:40:26 +00:00
parent cba650953a
commit 3a1743fc7f
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD

View File

@ -1727,7 +1727,7 @@ bool CCoinJoinClientSession::CreateDenominated(CAmount nBalanceToDenominate, con
}
bool finished = true;
for (const auto [denom, count] : mapDenomCount) {
for (const auto& [denom, count] : mapDenomCount) {
// Check if this specific denom could use another loop, check that there aren't nCoinJoinDenomsGoal of this
// denom and that our nValueLeft/nBalanceToDenominate is enough to create one of these denoms, if so, loop again.
if (count < CCoinJoinClientOptions::GetDenomsGoal() && txBuilder.CouldAddOutput(denom) && nBalanceToDenominate > 0) {
@ -1807,7 +1807,7 @@ bool CCoinJoinClientSession::CreateDenominated(CAmount nBalanceToDenominate, con
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::%s -- 3 - nBalanceToDenominate: %f, %s\n", __func__, (float) nBalanceToDenominate / COIN, txBuilder.ToString());
for (const auto [denom, count] : mapDenomCount) {
for (const auto& [denom, count] : mapDenomCount) {
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::%s -- 3 - DONE - nDenomValue: %f, count: %d\n", __func__, (float) denom / COIN, count);
}