util/DoublyLinkedList: make GetPrevious/GetNext methods static

This methods do not need DoublyLinkedList class state.

sGetLink field that actually implement GetPrevious/GetNext methods is already static.

Change-Id: Ie0b40f7f1b72d640d75403905b8944666874dc87
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5796
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
X512 2022-11-02 07:11:10 +09:00 committed by waddlesplash
parent baf401757e
commit b71020b095

@ -356,8 +356,8 @@ public:
inline Element* RemoveHead();
inline Element* RemoveTail();
inline Element* GetPrevious(Element* element) const;
inline Element* GetNext(Element* element) const;
static inline Element* GetPrevious(Element* element);
static inline Element* GetNext(Element* element);
inline bool Contains(Element* element) const;
// O(n)!
@ -605,7 +605,7 @@ DOUBLY_LINKED_LIST_CLASS_NAME::RemoveTail()
// GetPrevious
DOUBLY_LINKED_LIST_TEMPLATE_LIST
Element*
DOUBLY_LINKED_LIST_CLASS_NAME::GetPrevious(Element* element) const
DOUBLY_LINKED_LIST_CLASS_NAME::GetPrevious(Element* element)
{
Element* result = NULL;
if (element)
@ -616,7 +616,7 @@ DOUBLY_LINKED_LIST_CLASS_NAME::GetPrevious(Element* element) const
// GetNext
DOUBLY_LINKED_LIST_TEMPLATE_LIST
Element*
DOUBLY_LINKED_LIST_CLASS_NAME::GetNext(Element* element) const
DOUBLY_LINKED_LIST_CLASS_NAME::GetNext(Element* element)
{
Element* result = NULL;
if (element)