mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:58:11 +00:00
AK: Add basic Traits for RefPtr
This allows RefPtr to be stored in a HashTable<RefPtr<T>> :^) It's unfortunate about the const_casts. We'll need to fix HashMap::get to play nice with non-const Traits<T>::PeekType at some point.
This commit is contained in:
parent
9794e18a20
commit
a6e69bda71
5 changed files with 13 additions and 6 deletions
|
@ -39,7 +39,7 @@ static HashMap<i32, RefPtr<Download>>& all_downloads()
|
|||
|
||||
Download* Download::find_by_id(i32 id)
|
||||
{
|
||||
return all_downloads().get(id).value_or(nullptr);
|
||||
return const_cast<Download*>(all_downloads().get(id).value_or(nullptr));
|
||||
}
|
||||
|
||||
Download::Download(PSClientConnection& client)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue