AK: Use IntrusiveList::remove() in the IntrusiveList::prepend() prolog

All other functions use the functionality for removal, use it in the
prepend function as well for consistency.
This commit is contained in:
Brian Gianforcaro 2021-06-15 02:31:58 -07:00 committed by Andreas Kling
parent 13dc26eb0f
commit 4586668fc3
Notes: sideshowbarker 2024-07-18 12:12:26 +09:00

View file

@ -248,10 +248,9 @@ inline void IntrusiveList<T, Container, member>::append(T& n)
template<class T, typename Container, IntrusiveListNode<T, Container> T::*member>
inline void IntrusiveList<T, Container, member>::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;