util/IntrusiveList: use auto

Fixes typos in the const_iterator return types, and fixes returning
references to stack values.
This commit is contained in:
Max Kellermann 2022-11-11 16:32:54 +01:00
parent af544bb16f
commit 838c057231

View File

@ -396,17 +396,17 @@ public:
return Cast(cursor); return Cast(cursor);
} }
iterator &operator++() noexcept { auto &operator++() noexcept {
cursor = cursor->next; cursor = cursor->next;
return *this; return *this;
} }
iterator &operator--() noexcept { auto &operator--() noexcept {
cursor = cursor->prev; cursor = cursor->prev;
return *this; return *this;
} }
iterator &operator--(int) noexcept { auto operator--(int) noexcept {
auto old = *this; auto old = *this;
cursor = cursor->prev; cursor = cursor->prev;
return old; return old;
@ -461,17 +461,17 @@ public:
return Cast(cursor); return Cast(cursor);
} }
const_iterator &operator++() noexcept { auto &operator++() noexcept {
cursor = cursor->next; cursor = cursor->next;
return *this; return *this;
} }
iterator &operator--() noexcept { auto &operator--() noexcept {
cursor = cursor->prev; cursor = cursor->prev;
return *this; return *this;
} }
iterator &operator--(int) noexcept { auto operator--(int) noexcept {
auto old = *this; auto old = *this;
cursor = cursor->prev; cursor = cursor->prev;
return old; return old;