mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
refactor: Use move semantics in CCheckQueue::Add
Co-authored-by: Martin Leitner-Ankerl <martin.ankerl@gmail.com>
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <util/threadnames.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
template <typename T>
|
||||
@@ -173,10 +174,7 @@ public:
|
||||
|
||||
{
|
||||
LOCK(m_mutex);
|
||||
for (T& check : vChecks) {
|
||||
queue.emplace_back();
|
||||
check.swap(queue.back());
|
||||
}
|
||||
queue.insert(queue.end(), std::make_move_iterator(vChecks.begin()), std::make_move_iterator(vChecks.end()));
|
||||
nTodo += vChecks.size();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user