mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:07:45 +00:00
CircularQueue: Move construct a T object instead of copy constructing it
This commit is contained in:
parent
717cd5015e
commit
a57f074187
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ public:
|
||||||
if (m_size == Capacity)
|
if (m_size == Capacity)
|
||||||
slot.~T();
|
slot.~T();
|
||||||
|
|
||||||
new (&slot) T(value);
|
new (&slot) T(move(value));
|
||||||
if (m_size == Capacity)
|
if (m_size == Capacity)
|
||||||
m_head = (m_head + 1) % Capacity;
|
m_head = (m_head + 1) % Capacity;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue