mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:47:35 +00:00
Convert HashMap<Key, OwnPtr<T>> to HashMap<Key, NonnullOwnPtr<T>>.
In every case I found, we never wanted to support null entry values. With NonnullOwnPtr, we can encode that at the type level. :^)
This commit is contained in:
parent
3c5befde36
commit
93489fbc4c
8 changed files with 13 additions and 13 deletions
|
@ -1,11 +1,11 @@
|
|||
#include <Kernel/SharedBuffer.h>
|
||||
#include <Kernel/Process.h>
|
||||
|
||||
Lockable<HashMap<int, OwnPtr<SharedBuffer>>>& shared_buffers()
|
||||
Lockable<HashMap<int, NonnullOwnPtr<SharedBuffer>>>& shared_buffers()
|
||||
{
|
||||
static Lockable<HashMap<int, OwnPtr<SharedBuffer>>>* map;
|
||||
static Lockable<HashMap<int, NonnullOwnPtr<SharedBuffer>>>* map;
|
||||
if (!map)
|
||||
map = new Lockable<HashMap<int, OwnPtr<SharedBuffer>>>;
|
||||
map = new Lockable<HashMap<int, NonnullOwnPtr<SharedBuffer>>>;
|
||||
return *map;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue