mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:27:45 +00:00
Add an InlineLinkedList::containsSlow(T*) helper.
This commit is contained in:
parent
a89bebfda4
commit
e38f40a83c
1 changed files with 9 additions and 0 deletions
|
@ -58,6 +58,15 @@ public:
|
||||||
void remove(T*);
|
void remove(T*);
|
||||||
void append(InlineLinkedList<T>&);
|
void append(InlineLinkedList<T>&);
|
||||||
|
|
||||||
|
bool containsSlow(T* value) const
|
||||||
|
{
|
||||||
|
for (T* node = m_head; node; node = node->next()) {
|
||||||
|
if (node == value)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T* m_head { nullptr };
|
T* m_head { nullptr };
|
||||||
T* m_tail { nullptr };
|
T* m_tail { nullptr };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue