diff options
author | fanquake <fanquake@gmail.com> | 2023-03-27 14:22:37 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-03-27 14:34:52 +0100 |
commit | 39630675553280fe72254de69ec1ed2bc8fc9808 (patch) | |
tree | c65e616e43952456894989de68d6541d6b79a08b /src/wallet | |
parent | 3e835ca95863b1350a6425dad6e2bc604e01ecdf (diff) | |
parent | 03ec5b6f9ca3af28c9ce25cf2393e28ae852d808 (diff) |
Merge bitcoin/bitcoin#26642: clang-tidy: Add more `performance-*` checks and related fixes
03ec5b6f9ca3af28c9ce25cf2393e28ae852d808 clang-tidy: Exclude `performance-*` checks rather including them (Hennadii Stepanov)
24004372302adfc0e7cb36f8db6830694bf050e9 clang-tidy: Add `performance-type-promotion-in-math-fn` check (Hennadii Stepanov)
7e975e6cf86617346c1d8e2568f74a0252c03857 clang-tidy: Add `performance-inefficient-vector-operation` check (Hennadii Stepanov)
516b75f66ec3ba7495fc028c750937bd66cc9bba clang-tidy: Add `performance-faster-string-find` check (Hennadii Stepanov)
Pull request description:
ACKs for top commit:
martinus:
ACK 03ec5b6f9ca3af28c9ce25cf2393e28ae852d808
TheCharlatan:
re-ACK [03ec5b6](https://github.com/bitcoin/bitcoin/pull/26642/commits/03ec5b6f9ca3af28c9ce25cf2393e28ae852d808)
Tree-SHA512: 2dfa52f9131da88826f32583bfd534a56a998477db9804b7333c0e7ac0b6b36141009755c7163b9f95d0ecbf5c2cb63f8a69ce4b114bb83423faed21b50cec67
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/bdb.cpp | 1 | ||||
-rw-r--r-- | src/wallet/rpc/backup.cpp | 1 | ||||
-rw-r--r-- | src/wallet/scriptpubkeyman.cpp | 2 |
3 files changed, 4 insertions, 0 deletions
diff --git a/src/wallet/bdb.cpp b/src/wallet/bdb.cpp index 653115aa81..4d3285333f 100644 --- a/src/wallet/bdb.cpp +++ b/src/wallet/bdb.cpp @@ -432,6 +432,7 @@ void BerkeleyEnvironment::ReloadDbEnv() }); std::vector<fs::path> filenames; + filenames.reserve(m_databases.size()); for (const auto& it : m_databases) { filenames.push_back(it.first); } diff --git a/src/wallet/rpc/backup.cpp b/src/wallet/rpc/backup.cpp index 09cfc07bc2..9b6b3d629c 100644 --- a/src/wallet/rpc/backup.cpp +++ b/src/wallet/rpc/backup.cpp @@ -752,6 +752,7 @@ RPCHelpMan dumpwallet() // sort time/key pairs std::vector<std::pair<int64_t, CKeyID> > vKeyBirth; + vKeyBirth.reserve(mapKeyBirth.size()); for (const auto& entry : mapKeyBirth) { vKeyBirth.push_back(std::make_pair(entry.second, entry.first)); } diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index 1589e52deb..a1956049e2 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -1507,6 +1507,7 @@ std::vector<CKeyID> GetAffectedKeys(const CScript& spk, const SigningProvider& p FlatSigningProvider out; InferDescriptor(spk, provider)->Expand(0, DUMMY_SIGNING_PROVIDER, dummy, out); std::vector<CKeyID> ret; + ret.reserve(out.pubkeys.size()); for (const auto& entry : out.pubkeys) { ret.push_back(entry.first); } @@ -2501,6 +2502,7 @@ TransactionError DescriptorScriptPubKeyMan::FillPSBT(PartiallySignedTransaction& } else { // Maybe there are pubkeys listed that we can sign for std::vector<CPubKey> pubkeys; + pubkeys.reserve(input.hd_keypaths.size() + 2); // ECDSA Pubkeys for (const auto& [pk, _] : input.hd_keypaths) { |