diff options
author | fanquake <fanquake@gmail.com> | 2023-10-16 14:56:54 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-10-16 15:35:50 +0100 |
commit | 08ea835220baa88a0e226eff90f66bbae3eb7a0f (patch) | |
tree | d8760ac8bc90b3524abac8f8fa13f11cd8d83633 /src/test/util_threadnames_tests.cpp | |
parent | 92704535f66976c09a658348e554d47b7f7bcf6e (diff) | |
parent | fa05a726c225dc65dee79367bb67f099ae4f99e6 (diff) |
Merge bitcoin/bitcoin#28583: refactor: [tidy] modernize-use-emplace
fa05a726c225dc65dee79367bb67f099ae4f99e6 tidy: modernize-use-emplace (MarcoFalke)
Pull request description:
Constructing a temporary unnamed object only to copy or move it into a container seems both verbose in code and a strict performance penalty.
Fix both issues via the `modernize-use-emplace` tidy check.
ACKs for top commit:
Sjors:
re-utACK fa05a726c2
hebasto:
ACK fa05a726c225dc65dee79367bb67f099ae4f99e6.
TheCharlatan:
ACK fa05a726c225dc65dee79367bb67f099ae4f99e6
Tree-SHA512: 4408a094f406e7bf6c1468c2b0798f68f4d952a1253cf5b20bdc648ad7eea4a2c070051fed46d66fd37bce2ce6f85962484a1d32826b7ab8c9baba431eaa2765
Diffstat (limited to 'src/test/util_threadnames_tests.cpp')
-rw-r--r-- | src/test/util_threadnames_tests.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/util_threadnames_tests.cpp b/src/test/util_threadnames_tests.cpp index ae913939e8..45d3a58fd3 100644 --- a/src/test/util_threadnames_tests.cpp +++ b/src/test/util_threadnames_tests.cpp @@ -40,7 +40,7 @@ std::set<std::string> RenameEnMasse(int num_threads) threads.reserve(num_threads); for (int i = 0; i < num_threads; ++i) { - threads.push_back(std::thread(RenameThisThread, i)); + threads.emplace_back(RenameThisThread, i); } for (std::thread& thread : threads) thread.join(); |