diff options
| author | Rye <rye@lindenlab.com> | 2025-02-03 11:42:21 -0500 |
|---|---|---|
| committer | Rye <rye@lindenlab.com> | 2025-02-11 05:04:09 -0500 |
| commit | 594a7afce6a8b2e6a658d14881b8247b3a63efd8 (patch) | |
| tree | 03c976efcba083568a94bd5392818932afe644ef /indra/llcommon/llthreadsafequeue.h | |
| parent | 36d4dc4e2be8ac6c6d042b0a1e5c130b6544ef7f (diff) | |
Fix pessimizing move warning being emitted by the compiler
Diffstat (limited to 'indra/llcommon/llthreadsafequeue.h')
| -rw-r--r-- | indra/llcommon/llthreadsafequeue.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/indra/llcommon/llthreadsafequeue.h b/indra/llcommon/llthreadsafequeue.h index 034e3f7897..1a1d06a6fd 100644 --- a/indra/llcommon/llthreadsafequeue.h +++ b/indra/llcommon/llthreadsafequeue.h @@ -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) |
