diff --git a/AK/IntrusiveList.h b/AK/IntrusiveList.h index a5cdc77bbe7..dcc6b0948bf 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;