mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
AK: Oops, the optimization in Vector::append(Vector&&) was broken.
It forgot to clear out the moved-from vector. It's easy to see where this bug came from: I assumed m_impl was an OwnPtr. It would be comfy if move() on some arbitrary T* would also null it out but alas that's not how things work.
This commit is contained in:
parent
298a49c688
commit
fd5136a1ab
1 changed files with 2 additions and 1 deletions
|
@ -173,7 +173,8 @@ public:
|
|||
void append(Vector<T>&& other)
|
||||
{
|
||||
if (!m_impl) {
|
||||
m_impl = move(other.m_impl);
|
||||
m_impl = other.m_impl;
|
||||
other.m_impl = nullptr;
|
||||
return;
|
||||
}
|
||||
Vector<T> tmp = move(other);
|
||||
|
|
Loading…
Add table
Reference in a new issue