From 7a6672b7ed734b803eb6d68057289ee5da6291ff Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 12 Nov 2024 08:17:15 +0100 Subject: [PATCH] util/IntrusiveTreeSet: update the counter, fixing constant_time_size --- src/util/IntrusiveTreeSet.hxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/IntrusiveTreeSet.hxx b/src/util/IntrusiveTreeSet.hxx index 6594f8b26..72989762b 100644 --- a/src/util/IntrusiveTreeSet.hxx +++ b/src/util/IntrusiveTreeSet.hxx @@ -365,6 +365,8 @@ public: SetRoot(root); + ++counter; + return iterator_to(value); } @@ -374,6 +376,7 @@ public: auto *next = RedBlackTreeNode::GetNextNode(i.node); Cast(i.node)->unlink(); + --counter; return iterator{next}; }