mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03: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
Notes:
sideshowbarker
2024-07-19 15:47:28 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/fd5136a1ab4
@ -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…
Reference in New Issue
Block a user