diff --git a/src/db/upnp/WorkQueue.hxx b/src/db/upnp/WorkQueue.hxx index 274b85995..7537fb874 100644 --- a/src/db/upnp/WorkQueue.hxx +++ b/src/db/upnp/WorkQueue.hxx @@ -119,11 +119,12 @@ public: * * Sleeps if there are already too many. */ - bool put(T t) + template + bool put(U &&u) { const ScopeLock protect(mutex); - queue.push(t); + queue.emplace(std::forward(u)); // Just wake one worker, there is only one new task. worker_cond.signal(); @@ -178,7 +179,7 @@ public: return false; } - tp = queue.front(); + tp = std::move(queue.front()); queue.pop(); return true; }