From f59e5e67f0b522d4ae0d46b99b7a5f1fb07dbd54 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 2 Jun 2017 16:03:21 -0700 Subject: [PATCH] Merge #10500: Avoid CWalletTx copies in GetAddressBalances and GetAddressGroupings b9b814a38 Avoid CWalletTx copies in GetAddressBalances and GetAddressGroupings (Russell Yanofsky) Tree-SHA512: 96a0612ca460ba1bfb3921f3aa348400fd3afa12c40f2ca1f3f04068b1574fe824d577e0123013d8898a4990084316dc1dfb541331849f0996ceff7f4eb25e6b --- 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 70e92f9d6..6c623bb06 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4270,9 +4270,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; @@ -4310,9 +4310,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) {