Skip to content

Commit 9a0b524

Browse files
committed
clang-tidy, test: Fix bugprone-use-after-move in Correct_Queue_range()
1 parent 04831fe commit 9a0b524

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/checkqueue_tests.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,14 @@ static void Correct_Queue_range(std::vector<size_t> range)
184184
small_queue->StartWorkerThreads(SCRIPT_CHECK_THREADS);
185185
// Make vChecks here to save on malloc (this test can be slow...)
186186
std::vector<FakeCheckCheckCompletion> vChecks;
187+
vChecks.reserve(9);
187188
for (const size_t i : range) {
188189
size_t total = i;
189190
FakeCheckCheckCompletion::n_calls = 0;
190191
CCheckQueueControl<FakeCheckCheckCompletion> control(small_queue.get());
191192
while (total) {
192-
vChecks.resize(std::min(total, (size_t) InsecureRandRange(10)));
193+
vChecks.clear();
194+
vChecks.resize(std::min<size_t>(total, InsecureRandRange(10)));
193195
total -= vChecks.size();
194196
control.Add(std::move(vChecks));
195197
}

0 commit comments

Comments
 (0)