Fix pessimizing move warning being emitted by the compiler
parent
36d4dc4e2b
commit
594a7afce6
|
|
@ -452,7 +452,9 @@ ElementT LLThreadSafeQueue<ElementT, QueueT>::pop(void)
|
|||
// so we can finish draining the queue.
|
||||
pop_result popped = pop_(lock1, value);
|
||||
if (popped == POPPED)
|
||||
return std::move(value);
|
||||
// don't use std::move when returning local value because
|
||||
// it prevents the compiler from optimizing with copy elision
|
||||
return value;
|
||||
|
||||
// Once the queue is DONE, there will never be any more coming.
|
||||
if (popped == DONE)
|
||||
|
|
|
|||
Loading…
Reference in New Issue