From c3390bdca046a82f6ddc35aafd56bbd0a492bb7d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 10 Feb 2025 12:58:12 -0500 Subject: Reserve vector space before emplacing in a loop --- test/maid_test.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'test') 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 litterers; + litterers.reserve(n_threads); for (size_t i = 0; i < n_threads; ++i) { litterers.emplace_back(litter, &maid); } -- cgit v1.2.1