From e38f40a83c0962386c73d9024099d129dfee1bb3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 21 Oct 2018 23:48:27 +0200 Subject: [PATCH] Add an InlineLinkedList::containsSlow(T*) helper. --- Kernel/InlineLinkedList.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Kernel/InlineLinkedList.h b/Kernel/InlineLinkedList.h index 2c83a710e1..c51ef13cea 100644 --- a/Kernel/InlineLinkedList.h +++ b/Kernel/InlineLinkedList.h @@ -58,6 +58,15 @@ public: void remove(T*); void append(InlineLinkedList&); + bool containsSlow(T* value) const + { + for (T* node = m_head; node; node = node->next()) { + if (node == value) + return true; + } + return false; + } + private: T* m_head { nullptr }; T* m_tail { nullptr };