diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2018-06-18 07:58:28 +0200 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2018-08-27 18:19:33 +0200 |
commit | f34c8c466a0e514edac2e8683127b4176ad5d321 (patch) | |
tree | 587ba001d5d6eaae71d234009098710dd30354c3 /src/rpc | |
parent | f180e81d5780805a28bcc71c2bb6b16076336c3c (diff) |
Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations.
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/blockchain.cpp | 2 | ||||
-rw-r--r-- | src/rpc/mining.cpp | 2 | ||||
-rw-r--r-- | src/rpc/net.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index a77fea8ea8..ee895bdbe8 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -426,7 +426,7 @@ static void entryToJSON(UniValue &info, const CTxMemPoolEntry &e) EXCLUSIVE_LOCK UniValue spent(UniValue::VARR); const CTxMemPool::txiter &it = mempool.mapTx.find(tx.GetHash()); const CTxMemPool::setEntries &setChildren = mempool.GetMemPoolChildren(it); - for (const CTxMemPool::txiter &childiter : setChildren) { + for (CTxMemPool::txiter childiter : setChildren) { spent.push_back(childiter->GetTx().GetHash().ToString()); } diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 623b0bd86a..e7de256078 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -922,7 +922,7 @@ static UniValue estimaterawfee(const JSONRPCRequest& request) UniValue result(UniValue::VOBJ); - for (FeeEstimateHorizon horizon : {FeeEstimateHorizon::SHORT_HALFLIFE, FeeEstimateHorizon::MED_HALFLIFE, FeeEstimateHorizon::LONG_HALFLIFE}) { + for (const FeeEstimateHorizon horizon : {FeeEstimateHorizon::SHORT_HALFLIFE, FeeEstimateHorizon::MED_HALFLIFE, FeeEstimateHorizon::LONG_HALFLIFE}) { CFeeRate feeRate; EstimationResult buckets; diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 343b7d3b05..169a452659 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -164,7 +164,7 @@ static UniValue getpeerinfo(const JSONRPCRequest& request) obj.pushKV("synced_headers", statestats.nSyncHeight); obj.pushKV("synced_blocks", statestats.nCommonHeight); UniValue heights(UniValue::VARR); - for (int height : statestats.vHeightInFlight) { + for (const int height : statestats.vHeightInFlight) { heights.push_back(height); } obj.pushKV("inflight", heights); |