mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 08:11:13 +00:00
CircularQueue: Move construct a T object instead of copy constructing it
This commit is contained in:
parent
717cd5015e
commit
a57f074187
Notes:
sideshowbarker
2024-07-19 17:38:34 +09:00
Author: https://github.com/f-eiwu Commit: https://github.com/SerenityOS/serenity/commit/a57f074187e Pull-request: https://github.com/SerenityOS/serenity/pull/1301 Reviewed-by: https://github.com/awesomekling
|
@ -64,7 +64,7 @@ public:
|
|||
if (m_size == Capacity)
|
||||
slot.~T();
|
||||
|
||||
new (&slot) T(value);
|
||||
new (&slot) T(move(value));
|
||||
if (m_size == Capacity)
|
||||
m_head = (m_head + 1) % Capacity;
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue