aboutsummaryrefslogtreecommitdiff
path: root/src/bench
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2023-03-26 20:17:55 +0100
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2023-03-26 20:17:55 +0100
commit7e975e6cf86617346c1d8e2568f74a0252c03857 (patch)
tree4c102e4b6a5139106aa9b2f085ab57a68a36953a /src/bench
parent516b75f66ec3ba7495fc028c750937bd66cc9bba (diff)
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/bench')
-rw-r--r--src/bench/lockedpool.cpp4
-rw-r--r--src/bench/wallet_create_tx.cpp1
2 files changed, 2 insertions, 3 deletions
diff --git a/src/bench/lockedpool.cpp b/src/bench/lockedpool.cpp
index 161f9af621..6851ed0bd8 100644
--- a/src/bench/lockedpool.cpp
+++ b/src/bench/lockedpool.cpp
@@ -17,9 +17,7 @@ static void BenchLockedPool(benchmark::Bench& bench)
const size_t synth_size = 1024*1024;
Arena b(synth_base, synth_size, 16);
- std::vector<void*> addr;
- for (int x=0; x<ASIZE; ++x)
- addr.push_back(nullptr);
+ std::vector<void*> addr{ASIZE, nullptr};
uint32_t s = 0x12345678;
bench.run([&] {
int idx = s & (addr.size() - 1);
diff --git a/src/bench/wallet_create_tx.cpp b/src/bench/wallet_create_tx.cpp
index bd32a5abdc..80d23d1e51 100644
--- a/src/bench/wallet_create_tx.cpp
+++ b/src/bench/wallet_create_tx.cpp
@@ -146,6 +146,7 @@ static void AvailableCoins(benchmark::Bench& bench, const std::vector<OutputType
// Generate destinations
std::vector<CScript> dest_wallet;
+ dest_wallet.reserve(output_type.size());
for (auto type : output_type) {
dest_wallet.emplace_back(GetScriptForDestination(getNewDestination(wallet, type)));
}