summaryrefslogtreecommitdiff
path: root/Source/Kernel/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Kernel/Library')
-rw-r--r--Source/Kernel/Library/SimpleList.class.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/Kernel/Library/SimpleList.class.h b/Source/Kernel/Library/SimpleList.class.h
index 770128e..64e37aa 100644
--- a/Source/Kernel/Library/SimpleList.class.h
+++ b/Source/Kernel/Library/SimpleList.class.h
@@ -45,6 +45,17 @@ class SimpleList {
Mem::kfree(temp);
}
+ SimpleList<T>* removeOnce(const T& value) {
+ if (value == m_value) return delThis();
+ for (SimpleList<T> *iter = this; iter->next() != 0; iter = iter->next()) {
+ if (iter->next()->v() == value) {
+ iter->delNext();
+ break;
+ }
+ }
+ return this;
+ }
+
bool isEnd() {
return m_next == 0;
}