From 01c364cc24b1f356e12c91b7f2da68f3ba799e82 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 4 Sep 2019 15:34:02 -0700 Subject: [PATCH] ircd::ctx: Minor cleanup for promise/future list traversal; remove mutable_cast. --- ircd/ctx.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ircd/ctx.cc b/ircd/ctx.cc index dd4482bda..2d478f032 100644 --- a/ircd/ctx.cc +++ b/ircd/ctx.cc @@ -2069,7 +2069,7 @@ ircd::ctx::promise_base::refcount(const shared_state_base &st) if(!is(st, future_state::PENDING)) return ret; - for(const auto *next(head(mutable_cast(st))); next; next = next->next) + for(const auto *next(head(st)); next; next = next->next) ++ret; return ret; @@ -2129,10 +2129,10 @@ ircd::ctx::remove(promise_base &p) } if(last) - for(auto *next{last->next}; next; last = next, next = last->next) + for(auto *next{last->next}; next; last = next, next = next->next) if(next == &p) { - last->next = p.next; + last->next = next->next; break; } @@ -2377,7 +2377,7 @@ noexcept { const auto refcount { - this->refcount(*this) + shared_state_base::refcount(*this) }; assert(refcount >= 1); @@ -2481,10 +2481,10 @@ ircd::ctx::remove(shared_state_base &st) } assert(last); - for(auto *next(last->next); next; last = next, next = last->next) + for(auto *next(last->next); next; last = next, next = next->next) if(next == &st) { - last->next = st.next; + last->next = next->next; break; }