From 4586668fc38ecd14ab14b78eb4a44c41469f67d5 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Tue, 15 Jun 2021 02:31:58 -0700 Subject: [PATCH] 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. --- AK/IntrusiveList.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/AK/IntrusiveList.h b/AK/IntrusiveList.h index a5cdc77bbe..dcc6b0948b 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;