summaryrefslogtreecommitdiff
path: root/AK/IntrusiveList.h
diff options
context:
space:
mode:
authorBrian Gianforcaro <b.gianfo@gmail.com>2021-04-19 23:27:26 -0700
committerLinus Groh <mail@linusgroh.de>2021-04-21 19:31:49 +0200
commit93e5ba23476906f3a4cd1f9fd7fdfbaef5267525 (patch)
tree6903546890ebc7e149f76e561174487ffd17e517 /AK/IntrusiveList.h
parent0e63a7255e046d5ad7f9ecd8ca0a01126fcf108a (diff)
downloadserenity-93e5ba23476906f3a4cd1f9fd7fdfbaef5267525.zip
AK: Fix IntrusvieList::take_first/last() actually compile with RefPtr<T>
PR #6376 made IntrusiveList capable of holding RefPtr<T>, 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.
Diffstat (limited to 'AK/IntrusiveList.h')
-rw-r--r--AK/IntrusiveList.h4
1 files 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<T, Container, member>::first() const
template<class T, typename Container, IntrusiveListNode<T, Container> T::*member>
inline Container IntrusiveList<T, Container, member>::take_first()
{
- if (auto* ptr = first()) {
+ if (Container ptr = first()) {
remove(*ptr);
return ptr;
}
@@ -256,7 +256,7 @@ inline Container IntrusiveList<T, Container, member>::take_first()
template<class T, typename Container, IntrusiveListNode<T, Container> T::*member>
inline Container IntrusiveList<T, Container, member>::take_last()
{
- if (auto* ptr = last()) {
+ if (Container ptr = last()) {
remove(*ptr);
return ptr;
}