diff --git a/lib/base/workqueue.hpp b/lib/base/workqueue.hpp index a6cfb7216..fc3711555 100644 --- a/lib/base/workqueue.hpp +++ b/lib/base/workqueue.hpp @@ -67,15 +67,14 @@ public: void Join(bool stop = false); template - void ParallelFor(const VectorType& items, const FuncType& func) + void ParallelFor(VectorType&& items, const FuncType& func) { - ParallelFor(items, true, func); + ParallelFor(std::forward(items), true, func); } - template - void ParallelFor(const VectorType& items, bool preChunk, const FuncType& func) + template>> + void ParallelFor(VectorType&& items, bool preChunk, const FuncType& func) { - const auto totalCount = std::size(items); using SizeType = std::remove_const_t; const auto chunks = preChunk ? m_ThreadCount : totalCount;