mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-07 03:03:58 +01:00
Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations.
This commit is contained in:
@@ -612,7 +612,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
|
||||
if ((wss.nKeys + wss.nCKeys + wss.nWatchKeys) != wss.nKeyMeta)
|
||||
pwallet->UpdateTimeFirstKey(1);
|
||||
|
||||
for (uint256 hash : wss.vWalletUpgrade)
|
||||
for (const uint256& hash : wss.vWalletUpgrade)
|
||||
WriteTx(pwallet->mapWallet.at(hash));
|
||||
|
||||
// Rewrite encrypted wallets of versions 0.4.0 and 0.5.0rc:
|
||||
@@ -709,7 +709,7 @@ DBErrors WalletBatch::ZapSelectTx(std::vector<uint256>& vTxHashIn, std::vector<u
|
||||
// erase each matching wallet TX
|
||||
bool delerror = false;
|
||||
std::vector<uint256>::iterator it = vTxHashIn.begin();
|
||||
for (uint256 hash : vTxHash) {
|
||||
for (const uint256& hash : vTxHash) {
|
||||
while (it < vTxHashIn.end() && (*it) < hash) {
|
||||
it++;
|
||||
}
|
||||
@@ -740,7 +740,7 @@ DBErrors WalletBatch::ZapWalletTx(std::vector<CWalletTx>& vWtx)
|
||||
return err;
|
||||
|
||||
// erase each wallet TX
|
||||
for (uint256& hash : vTxHash) {
|
||||
for (const uint256& hash : vTxHash) {
|
||||
if (!EraseTx(hash))
|
||||
return DBErrors::CORRUPT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user