Skip to content

Commit 9567bfe

Browse files
committed
1 parent e9262ea commit 9567bfe

File tree

12 files changed

+19
-17
lines changed

12 files changed

+19
-17
lines changed

src/.clang-tidy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ modernize-use-default-member-init,
77
modernize-use-nullptr,
88
performance-for-range-copy,
99
performance-move-const-arg,
10+
performance-no-automatic-move,
1011
performance-unnecessary-copy-initialization,
1112
readability-redundant-declaration,
1213
readability-redundant-string-init,
@@ -19,6 +20,7 @@ modernize-use-default-member-init,
1920
modernize-use-nullptr,
2021
performance-for-range-copy,
2122
performance-move-const-arg,
23+
performance-no-automatic-move,
2224
performance-unnecessary-copy-initialization,
2325
readability-redundant-declaration,
2426
readability-redundant-string-init,

src/addrman.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ std::pair<CAddress, NodeSeconds> AddrManImpl::SelectTriedCollision()
11121112
{
11131113
LOCK(cs);
11141114
Check();
1115-
const auto ret = SelectTriedCollision_();
1115+
auto ret = SelectTriedCollision_();
11161116
Check();
11171117
return ret;
11181118
}
@@ -1121,7 +1121,7 @@ std::pair<CAddress, NodeSeconds> AddrManImpl::Select(bool newOnly) const
11211121
{
11221122
LOCK(cs);
11231123
Check();
1124-
const auto addrRet = Select_(newOnly);
1124+
auto addrRet = Select_(newOnly);
11251125
Check();
11261126
return addrRet;
11271127
}
@@ -1130,7 +1130,7 @@ std::vector<CAddress> AddrManImpl::GetAddr(size_t max_addresses, size_t max_pct,
11301130
{
11311131
LOCK(cs);
11321132
Check();
1133-
const auto addresses = GetAddr_(max_addresses, max_pct, network);
1133+
auto addresses = GetAddr_(max_addresses, max_pct, network);
11341134
Check();
11351135
return addresses;
11361136
}

src/bitcoin-cli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ static UniValue CallRPC(BaseRequestHandler* rh, const std::string& strMethod, co
822822
UniValue valReply(UniValue::VSTR);
823823
if (!valReply.read(response.body))
824824
throw std::runtime_error("couldn't parse reply from server");
825-
const UniValue reply = rh->ProcessReply(valReply);
825+
UniValue reply = rh->ProcessReply(valReply);
826826
if (reply.empty())
827827
throw std::runtime_error("expected reply to have result, error and id properties");
828828

src/qt/platformstyle.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ QColor PlatformStyle::TextColor() const
8383
QColor PlatformStyle::SingleColor() const
8484
{
8585
if (colorizeIcons) {
86-
const QColor colorHighlightBg(QApplication::palette().color(QPalette::Highlight));
87-
const QColor colorHighlightFg(QApplication::palette().color(QPalette::HighlightedText));
86+
QColor colorHighlightBg(QApplication::palette().color(QPalette::Highlight));
87+
QColor colorHighlightFg(QApplication::palette().color(QPalette::HighlightedText));
8888
const QColor colorText(QApplication::palette().color(QPalette::WindowText));
8989
const int colorTextLightness = colorText.lightness();
9090
if (abs(colorHighlightBg.lightness() - colorTextLightness) < abs(colorHighlightFg.lightness() - colorTextLightness)) {

src/rpc/util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ UniValue RPCHelpMan::HandleRequest(const JSONRPCRequest& request) const
579579
if (request.mode == JSONRPCRequest::GET_HELP || !IsValidNumArgs(request.params.size())) {
580580
throw std::runtime_error(ToString());
581581
}
582-
const UniValue ret = m_fun(*this, request);
582+
UniValue ret = m_fun(*this, request);
583583
if (gArgs.GetBoolArg("-rpcdoccheck", DEFAULT_RPC_DOC_CHECK)) {
584584
CHECK_NONFATAL(std::any_of(m_results.m_results.begin(), m_results.m_results.end(), [&ret](const RPCResult& res) { return res.MatchesType(ret); }));
585585
}

src/test/fuzz/tx_pool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ FUZZ_TARGET_INIT(tx_pool_standard, initialize_tx_pool)
211211
for (int i = 0; i < num_out; ++i) {
212212
tx_mut.vout.emplace_back(amount_out, P2WSH_OP_TRUE);
213213
}
214-
const auto tx = MakeTransactionRef(tx_mut);
214+
auto tx = MakeTransactionRef(tx_mut);
215215
// Restore previously removed outpoints
216216
for (const auto& in : tx->vin) {
217217
Assert(outpoints_rbf.insert(in.prevout).second);

src/test/fuzz/txorphan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ FUZZ_TARGET_INIT(txorphan, initialize_orphanage)
6969
for (auto& in : tx_mut.vin) {
7070
outpoints.push_back(in.prevout);
7171
}
72-
const auto new_tx = MakeTransactionRef(tx_mut);
72+
auto new_tx = MakeTransactionRef(tx_mut);
7373
// add newly constructed transaction to outpoints
7474
for (uint32_t i = 0; i < num_out; i++) {
7575
outpoints.emplace_back(new_tx->GetHash(), i);

src/test/util/setup_common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ CBlock TestChain100Setup::CreateAndProcessBlock(
321321
chainstate = &Assert(m_node.chainman)->ActiveChainstate();
322322
}
323323

324-
const CBlock block = this->CreateBlock(txns, scriptPubKey, *chainstate);
324+
CBlock block = this->CreateBlock(txns, scriptPubKey, *chainstate);
325325
std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(block);
326326
Assert(m_node.chainman)->ProcessNewBlock(shared_pblock, true, true, nullptr);
327327

src/validation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ MempoolAcceptResult AcceptToMemoryPool(Chainstate& active_chainstate, const CTra
14111411

14121412
std::vector<COutPoint> coins_to_uncache;
14131413
auto args = MemPoolAccept::ATMPArgs::SingleAccept(chainparams, accept_time, bypass_limits, coins_to_uncache, test_accept);
1414-
const MempoolAcceptResult result = MemPoolAccept(pool, active_chainstate).AcceptSingleTransaction(tx, args);
1414+
MempoolAcceptResult result = MemPoolAccept(pool, active_chainstate).AcceptSingleTransaction(tx, args);
14151415
if (result.m_result_type != MempoolAcceptResult::ResultType::VALID) {
14161416
// Remove coins that were not present in the coins cache before calling
14171417
// AcceptSingleTransaction(); this is to prevent memory DoS in case we receive a large
@@ -1436,7 +1436,7 @@ PackageMempoolAcceptResult ProcessNewPackage(Chainstate& active_chainstate, CTxM
14361436

14371437
std::vector<COutPoint> coins_to_uncache;
14381438
const CChainParams& chainparams = active_chainstate.m_chainman.GetParams();
1439-
const auto result = [&]() EXCLUSIVE_LOCKS_REQUIRED(cs_main) {
1439+
auto result = [&]() EXCLUSIVE_LOCKS_REQUIRED(cs_main) {
14401440
AssertLockHeld(cs_main);
14411441
if (test_accept) {
14421442
auto args = MemPoolAccept::ATMPArgs::PackageTestAccept(chainparams, GetTime(), coins_to_uncache);

src/wallet/rpc/util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ std::shared_ptr<CWallet> GetWalletForJSONRPCRequest(const JSONRPCRequest& reques
7575

7676
std::string wallet_name;
7777
if (GetWalletNameFromJSONRPCRequest(request, wallet_name)) {
78-
const std::shared_ptr<CWallet> pwallet = GetWallet(context, wallet_name);
78+
std::shared_ptr<CWallet> pwallet = GetWallet(context, wallet_name);
7979
if (!pwallet) throw JSONRPCError(RPC_WALLET_NOT_FOUND, "Requested wallet does not exist or is not loaded");
8080
return pwallet;
8181
}

0 commit comments

Comments
 (0)