From 4912466d50c9620bfe23f2cbc84d467eeb446119 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 17 Feb 2021 20:19:19 +0100 Subject: [PATCH] util/IntrusiveList: add method erase() --- src/util/IntrusiveList.hxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/IntrusiveList.hxx b/src/util/IntrusiveList.hxx index c82b1035c..33c97b43f 100644 --- a/src/util/IntrusiveList.hxx +++ b/src/util/IntrusiveList.hxx @@ -312,6 +312,10 @@ public: return {&t}; } + void erase(iterator i) noexcept { + IntrusiveListHook(*i).unlink(); + } + void push_front(T &t) noexcept { auto &new_node = ToNode(t); head.next->prev = &new_node;