diff options
author | David Robillard <d@drobilla.net> | 2025-02-10 12:58:12 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2025-02-10 12:58:12 -0500 |
commit | c3390bdca046a82f6ddc35aafd56bbd0a492bb7d (patch) | |
tree | bc4f43a4f96272f05beb705c17f932e6ad7b109b /test | |
parent | 9a3b9f0981eee2febc71af8f6975fb3f190d7da4 (diff) | |
download | raul-c3390bdca046a82f6ddc35aafd56bbd0a492bb7d.tar.gz raul-c3390bdca046a82f6ddc35aafd56bbd0a492bb7d.tar.bz2 raul-c3390bdca046a82f6ddc35aafd56bbd0a492bb7d.zip |
Reserve vector space before emplacing in a loop
Diffstat (limited to 'test')
-rw-r--r-- | test/maid_test.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/maid_test.cpp b/test/maid_test.cpp index 2088c83..d6ee1db 100644 --- a/test/maid_test.cpp +++ b/test/maid_test.cpp @@ -84,6 +84,7 @@ test() // Create some threads to produce garbage std::vector<std::thread> litterers; + litterers.reserve(n_threads); for (size_t i = 0; i < n_threads; ++i) { litterers.emplace_back(litter, &maid); } |