clang-tidy, test: Fix bugprone-use-after-move in Correct_Queue_range()
This commit is contained in:
1 file changed
+3
-1
@@ -184,12 +184,14 @@ static void Correct_Queue_range(std::vector<size_t> range)
|
|||||||
small_queue->StartWorkerThreads(SCRIPT_CHECK_THREADS);
|
small_queue->StartWorkerThreads(SCRIPT_CHECK_THREADS);
|
||||||
// Make vChecks here to save on malloc (this test can be slow...)
|
// Make vChecks here to save on malloc (this test can be slow...)
|
||||||
std::vector<FakeCheckCheckCompletion> vChecks;
|
std::vector<FakeCheckCheckCompletion> vChecks;
|
||||||
|
vChecks.reserve(9);
|
||||||
for (const size_t i : range) {
|
for (const size_t i : range) {
|
||||||
size_t total = i;
|
size_t total = i;
|
||||||
FakeCheckCheckCompletion::n_calls = 0;
|
FakeCheckCheckCompletion::n_calls = 0;
|
||||||
CCheckQueueControl<FakeCheckCheckCompletion> control(small_queue.get());
|
CCheckQueueControl<FakeCheckCheckCompletion> control(small_queue.get());
|
||||||
while (total) {
|
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();
|
total -= vChecks.size();
|
||||||
control.Add(std::move(vChecks));
|
control.Add(std::move(vChecks));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user