From 93e5ba23476906f3a4cd1f9fd7fdfbaef5267525 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Mon, 19 Apr 2021 23:27:26 -0700 Subject: [PATCH] AK: Fix IntrusvieList::take_first/last() actually compile with RefPtr PR #6376 made IntrusiveList capable of holding RefPtr, etc. however there was a latent bug where take_first() / take_last() would fail to compile because they weren't being converted to their container type. --- AK/IntrusiveList.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AK/IntrusiveList.h b/AK/IntrusiveList.h index 411f6ca220..082a93ac3b 100644 --- a/AK/IntrusiveList.h +++ b/AK/IntrusiveList.h @@ -246,7 +246,7 @@ inline Container IntrusiveList::first() const template T::*member> inline Container IntrusiveList::take_first() { - if (auto* ptr = first()) { + if (Container ptr = first()) { remove(*ptr); return ptr; } @@ -256,7 +256,7 @@ inline Container IntrusiveList::take_first() template T::*member> inline Container IntrusiveList::take_last() { - if (auto* ptr = last()) { + if (Container ptr = last()) { remove(*ptr); return ptr; }