aboutsummaryrefslogtreecommitdiff
path: root/src/miner.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-06-24 16:34:56 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-06-24 16:36:40 +0200
commit31145a3d7c747dce4db5cebc1a3f9cdd91681cb5 (patch)
treee9bd92886a52fb843553964577cc8c7f3c56ebec /src/miner.cpp
parentdc53f7f2514026db8a28632371e73e6dbf858083 (diff)
parentd92204c900d55ebaf2af5c900162b3c2c8c296e2 (diff)
downloadbitcoin-31145a3d7c747dce4db5cebc1a3f9cdd91681cb5.tar.xz
Merge #13480: Avoid copies in range-for loops and add a warning to detect them
d92204c900d55ebaf2af5c900162b3c2c8c296e2 build: add warning to detect hidden copies in range-for loops (Cory Fields) 466e16e0e8523909f9968c5823691b1d4a3d8175 cleanup: avoid hidden copies in range-for loops (Cory Fields) Pull request description: Following-up on #13241, which was itself a follow-up of #12169. See title. Fixing these would otherwise be a continuous process, adding the warning should keep them from cropping up. Note that the warning seems to be Clang-only for now. Tree-SHA512: ccfb769c3128b3f92c95715abcf21ee2496fe2aa384f80efead1529a28eeb56b98995b531b49a089f8142601389e63f7bb935963d724eacde4f5e1b4a024934b
Diffstat (limited to 'src/miner.cpp')
-rw-r--r--src/miner.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/miner.cpp b/src/miner.cpp
index d4527a1d67..738ccad1b9 100644
--- a/src/miner.cpp
+++ b/src/miner.cpp
@@ -209,7 +209,7 @@ bool BlockAssembler::TestPackage(uint64_t packageSize, int64_t packageSigOpsCost
// segwit activation)
bool BlockAssembler::TestPackageTransactions(const CTxMemPool::setEntries& package)
{
- for (const CTxMemPool::txiter it : package) {
+ for (CTxMemPool::txiter it : package) {
if (!IsFinalTx(it->GetTx(), nHeight, nLockTimeCutoff))
return false;
if (!fIncludeWitness && it->GetTx().HasWitness())
@@ -241,7 +241,7 @@ int BlockAssembler::UpdatePackagesForAdded(const CTxMemPool::setEntries& already
indexed_modified_transaction_set &mapModifiedTx)
{
int nDescendantsUpdated = 0;
- for (const CTxMemPool::txiter it : alreadyAdded) {
+ for (CTxMemPool::txiter it : alreadyAdded) {
CTxMemPool::setEntries descendants;
mempool.CalculateDescendants(it, descendants);
// Insert all descendants (not yet in block) into the modified set