refactor: Fix remaining clang-tidy performance-inefficient-vector errors
This commit is contained in:
1 parent
2638fdb4f9
commit
a774c7a339
4 files changed
+4
No files matched your search
@@ -123,6 +123,7 @@ static RPCHelpMan createmultisig()
|
|||||||
// Get the public keys
|
// Get the public keys
|
||||||
const UniValue& keys = request.params[1].get_array();
|
const UniValue& keys = request.params[1].get_array();
|
||||||
std::vector<CPubKey> pubkeys;
|
std::vector<CPubKey> pubkeys;
|
||||||
|
pubkeys.reserve(keys.size());
|
||||||
for (unsigned int i = 0; i < keys.size(); ++i) {
|
for (unsigned int i = 0; i < keys.size(); ++i) {
|
||||||
pubkeys.push_back(HexToPubKey(keys[i].get_str()));
|
pubkeys.push_back(HexToPubKey(keys[i].get_str()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -360,6 +360,7 @@ BOOST_AUTO_TEST_CASE(test_CheckQueueControl_Locks)
|
|||||||
auto queue = std::make_unique<Standard_Queue>(QUEUE_BATCH_SIZE, SCRIPT_CHECK_THREADS);
|
auto queue = std::make_unique<Standard_Queue>(QUEUE_BATCH_SIZE, SCRIPT_CHECK_THREADS);
|
||||||
{
|
{
|
||||||
std::vector<std::thread> tg;
|
std::vector<std::thread> tg;
|
||||||
|
tg.reserve(3);
|
||||||
std::atomic<int> nThreads {0};
|
std::atomic<int> nThreads {0};
|
||||||
std::atomic<int> fails {0};
|
std::atomic<int> fails {0};
|
||||||
for (size_t i = 0; i < 3; ++i) {
|
for (size_t i = 0; i < 3; ++i) {
|
||||||
|
|||||||
@@ -224,6 +224,7 @@ void test_cache_erase_parallel(size_t megabytes)
|
|||||||
/** Spin up 3 threads to run contains with erase.
|
/** Spin up 3 threads to run contains with erase.
|
||||||
*/
|
*/
|
||||||
std::vector<std::thread> threads;
|
std::vector<std::thread> threads;
|
||||||
|
threads.reserve(3);
|
||||||
/** Erase the first quarter */
|
/** Erase the first quarter */
|
||||||
for (uint32_t x = 0; x < 3; ++x)
|
for (uint32_t x = 0; x < 3; ++x)
|
||||||
/** Each thread is emplaced with x copy-by-value
|
/** Each thread is emplaced with x copy-by-value
|
||||||
|
|||||||
@@ -428,6 +428,7 @@ BOOST_AUTO_TEST_CASE(rpc_getblockstats_calculate_percentiles_by_weight)
|
|||||||
{
|
{
|
||||||
int64_t total_weight = 200;
|
int64_t total_weight = 200;
|
||||||
std::vector<std::pair<CAmount, int64_t>> feerates;
|
std::vector<std::pair<CAmount, int64_t>> feerates;
|
||||||
|
feerates.reserve(200);
|
||||||
CAmount result[NUM_GETBLOCKSTATS_PERCENTILES] = { 0 };
|
CAmount result[NUM_GETBLOCKSTATS_PERCENTILES] = { 0 };
|
||||||
|
|
||||||
for (int64_t i = 0; i < 100; i++) {
|
for (int64_t i = 0; i < 100; i++) {
|
||||||
|
|||||||
Reference in new issue
Block a user