From b9b814a38ee768ec8a902544722b81c4b9866834 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Thu, 1 Jun 2017 11:48:29 -0400 Subject: [PATCH] Avoid CWalletTx copies in GetAddressBalances and GetAddressGroupings --- src/wallet/wallet.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 997515a04b..62d46ba72b 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3261,9 +3261,9 @@ std::map CWallet::GetAddressBalances() { LOCK(cs_wallet); - BOOST_FOREACH(PAIRTYPE(uint256, CWalletTx) walletEntry, mapWallet) + for (const auto& walletEntry : mapWallet) { - CWalletTx *pcoin = &walletEntry.second; + const CWalletTx *pcoin = &walletEntry.second; if (!pcoin->IsTrusted()) continue; @@ -3301,9 +3301,9 @@ std::set< std::set > CWallet::GetAddressGroupings() std::set< std::set > groupings; std::set grouping; - BOOST_FOREACH(PAIRTYPE(uint256, CWalletTx) walletEntry, mapWallet) + for (const auto& walletEntry : mapWallet) { - CWalletTx *pcoin = &walletEntry.second; + const CWalletTx *pcoin = &walletEntry.second; if (pcoin->tx->vin.size() > 0) {