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 <[email protected]> Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
@@ -356,8 +356,8 @@ public:
|
|||||||
inline Element* RemoveHead();
|
inline Element* RemoveHead();
|
||||||
inline Element* RemoveTail();
|
inline Element* RemoveTail();
|
||||||
|
|
||||||
inline Element* GetPrevious(Element* element) const;
|
static inline Element* GetPrevious(Element* element);
|
||||||
inline Element* GetNext(Element* element) const;
|
static inline Element* GetNext(Element* element);
|
||||||
|
|
||||||
inline bool Contains(Element* element) const;
|
inline bool Contains(Element* element) const;
|
||||||
// O(n)!
|
// O(n)!
|
||||||
@@ -605,7 +605,7 @@ DOUBLY_LINKED_LIST_CLASS_NAME::RemoveTail()
|
|||||||
// GetPrevious
|
// GetPrevious
|
||||||
DOUBLY_LINKED_LIST_TEMPLATE_LIST
|
DOUBLY_LINKED_LIST_TEMPLATE_LIST
|
||||||
Element*
|
Element*
|
||||||
DOUBLY_LINKED_LIST_CLASS_NAME::GetPrevious(Element* element) const
|
DOUBLY_LINKED_LIST_CLASS_NAME::GetPrevious(Element* element)
|
||||||
{
|
{
|
||||||
Element* result = NULL;
|
Element* result = NULL;
|
||||||
if (element)
|
if (element)
|
||||||
@@ -616,7 +616,7 @@ DOUBLY_LINKED_LIST_CLASS_NAME::GetPrevious(Element* element) const
|
|||||||
// GetNext
|
// GetNext
|
||||||
DOUBLY_LINKED_LIST_TEMPLATE_LIST
|
DOUBLY_LINKED_LIST_TEMPLATE_LIST
|
||||||
Element*
|
Element*
|
||||||
DOUBLY_LINKED_LIST_CLASS_NAME::GetNext(Element* element) const
|
DOUBLY_LINKED_LIST_CLASS_NAME::GetNext(Element* element)
|
||||||
{
|
{
|
||||||
Element* result = NULL;
|
Element* result = NULL;
|
||||||
if (element)
|
if (element)
|
||||||
|
|||||||
Reference in New Issue
Block a user