diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-03-26 20:17:55 +0100 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-03-26 20:17:55 +0100 |
commit | 7e975e6cf86617346c1d8e2568f74a0252c03857 (patch) | |
tree | 4c102e4b6a5139106aa9b2f085ab57a68a36953a /src/test/scheduler_tests.cpp | |
parent | 516b75f66ec3ba7495fc028c750937bd66cc9bba (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/test/scheduler_tests.cpp')
-rw-r--r-- | src/test/scheduler_tests.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/test/scheduler_tests.cpp b/src/test/scheduler_tests.cpp index 1301a1b219..3fb3378598 100644 --- a/src/test/scheduler_tests.cpp +++ b/src/test/scheduler_tests.cpp @@ -71,6 +71,7 @@ BOOST_AUTO_TEST_CASE(manythreads) // As soon as these are created they will start running and servicing the queue std::vector<std::thread> microThreads; + microThreads.reserve(10); for (int i = 0; i < 5; i++) microThreads.emplace_back(std::bind(&CScheduler::serviceQueue, µTasks)); @@ -136,6 +137,7 @@ BOOST_AUTO_TEST_CASE(singlethreadedscheduler_ordered) // the extra threads should effectively be doing nothing // if they don't we'll get out of order behaviour std::vector<std::thread> threads; + threads.reserve(5); for (int i = 0; i < 5; ++i) { threads.emplace_back([&] { scheduler.serviceQueue(); }); } |