mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
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:
parent
13dc26eb0f
commit
4586668fc3
Notes:
sideshowbarker
2024-07-18 12:12:26 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/4586668fc38 Pull-request: https://github.com/SerenityOS/serenity/pull/8073
1 changed files with 2 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue