diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-03-21 13:03:41 +0000 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-03-21 13:03:41 +0000 |
commit | 6c2d5972f3544c4f3e987828a99e88f27b62cf87 (patch) | |
tree | 276783d4e29f3c05ed5e23257b33c65befbc911d /src/checkqueue.h | |
parent | 06820032142a75cc3c5b832045058bc6f6f74786 (diff) |
refactor: Use move semantics in `CCheckQueue::Add`
Co-authored-by: Martin Leitner-Ankerl <martin.ankerl@gmail.com>
Diffstat (limited to 'src/checkqueue.h')
-rw-r--r-- | src/checkqueue.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/checkqueue.h b/src/checkqueue.h index d83f717fb7..63628860c5 100644 --- a/src/checkqueue.h +++ b/src/checkqueue.h @@ -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(); } |