mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 08:56:40 +00:00
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.
This commit is contained in:
parent
0e63a7255e
commit
93e5ba2347
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue