diff --git a/AK/IntrusiveList.h b/AK/IntrusiveList.h index a5cdc77bbe7ab8ea6b8c883dfebfd900a7abd5ac..dcc6b0948bf5401f9d70edc49c613de94e5c45bc 100644 --- a/AK/IntrusiveList.h +++ b/AK/IntrusiveList.h @@ -248,10 +248,9 @@ inline void IntrusiveList::append(T& n) template T::*member> inline void IntrusiveList::prepend(T& n) { - auto& nnode = n.*member; - if (nnode.m_storage) - nnode.remove(); + remove(n); + auto& nnode = n.*member; nnode.m_storage = &m_storage; nnode.m_prev = nullptr; nnode.m_next = m_storage.m_first;