diff --git a/src/common/intrusive_list.h b/src/common/intrusive_list.h index c7b402e7..3c3cab63 100644 --- a/src/common/intrusive_list.h +++ b/src/common/intrusive_list.h @@ -68,18 +68,18 @@ public: node = node == root ? node : node->next; return *this; } - IntrusiveListIterator operator++(int) { - IntrusiveListIterator it(*this); - node = node == root ? node : node->next; - return it; - } IntrusiveListIterator& operator--() { node = node->prev == root ? node : node->prev; return *this; } + IntrusiveListIterator operator++(int) { + IntrusiveListIterator it(*this); + ++*this; + return it; + } IntrusiveListIterator operator--(int) { IntrusiveListIterator it(*this); - node = node->prev == root ? node : node->prev; + --*this; return it; }