mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 21:54:40 +03: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
Notes:
sideshowbarker
2024-07-18 19:17:56 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/93e5ba23476 Pull-request: https://github.com/SerenityOS/serenity/pull/6509 Reviewed-by: https://github.com/alimpfard
@ -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 New Issue
Block a user