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