mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01:00
clang-tidy, test: Fix bugprone-use-after-move in Correct_Queue_range()
This commit is contained in:
parent
04831fee6d
commit
9a0b524139
@ -184,12 +184,14 @@ static void Correct_Queue_range(std::vector<size_t> range)
|
||||
small_queue->StartWorkerThreads(SCRIPT_CHECK_THREADS);
|
||||
// Make vChecks here to save on malloc (this test can be slow...)
|
||||
std::vector<FakeCheckCheckCompletion> vChecks;
|
||||
vChecks.reserve(9);
|
||||
for (const size_t i : range) {
|
||||
size_t total = i;
|
||||
FakeCheckCheckCompletion::n_calls = 0;
|
||||
CCheckQueueControl<FakeCheckCheckCompletion> control(small_queue.get());
|
||||
while (total) {
|
||||
vChecks.resize(std::min(total, (size_t) InsecureRandRange(10)));
|
||||
vChecks.clear();
|
||||
vChecks.resize(std::min<size_t>(total, InsecureRandRange(10)));
|
||||
total -= vChecks.size();
|
||||
control.Add(std::move(vChecks));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user