From 838c057231e2aebc14aa781793c7aca991bf8c36 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 11 Nov 2022 16:32:54 +0100 Subject: [PATCH] util/IntrusiveList: use `auto` Fixes typos in the const_iterator return types, and fixes returning references to stack values. --- src/util/IntrusiveList.hxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/util/IntrusiveList.hxx b/src/util/IntrusiveList.hxx index d5f267010..131695b44 100644 --- a/src/util/IntrusiveList.hxx +++ b/src/util/IntrusiveList.hxx @@ -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;