From b9b5c473d165c4ed59d012a9cd8e4c96dc546b74 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Tue, 12 Nov 2019 18:38:38 +0000 Subject: [PATCH] threadpool: use std::move when taking an element off the queue It has a std::function, which can have a capture context, and the function runtime might be small --- src/common/threadpool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/threadpool.cpp b/src/common/threadpool.cpp index 2748c798c..38f52c45b 100644 --- a/src/common/threadpool.cpp +++ b/src/common/threadpool.cpp @@ -145,7 +145,7 @@ void threadpool::run(bool flush) { if (!running) break; active++; - e = queue.front(); + e = std::move(queue.front()); queue.pop_front(); lock.unlock(); ++depth;