diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-03-26 20:17:55 +0100 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-03-26 20:17:55 +0100 |
commit | 7e975e6cf86617346c1d8e2568f74a0252c03857 (patch) | |
tree | 4c102e4b6a5139106aa9b2f085ab57a68a36953a /src/wallet/scriptpubkeyman.cpp | |
parent | 516b75f66ec3ba7495fc028c750937bd66cc9bba (diff) | |
download | bitcoin-7e975e6cf86617346c1d8e2568f74a0252c03857.tar.xz |
clang-tidy: Add `performance-inefficient-vector-operation` check
https://clang.llvm.org/extra/clang-tidy/checks/performance/inefficient-vector-operation.html
Diffstat (limited to 'src/wallet/scriptpubkeyman.cpp')
-rw-r--r-- | src/wallet/scriptpubkeyman.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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) { |