1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 19:07:34 +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:
Andreas Kling 2019-07-24 08:42:55 +02:00
parent 3c5befde36
commit 93489fbc4c
8 changed files with 13 additions and 13 deletions

View file

@ -21,7 +21,7 @@
static CEventLoop* s_main_event_loop;
static Vector<CEventLoop*>* s_event_loop_stack;
HashMap<int, OwnPtr<CEventLoop::EventLoopTimer>>* CEventLoop::s_timers;
HashMap<int, NonnullOwnPtr<CEventLoop::EventLoopTimer>>* CEventLoop::s_timers;
HashTable<CNotifier*>* CEventLoop::s_notifiers;
int CEventLoop::s_next_timer_id = 1;
int CEventLoop::s_wake_pipe_fds[2];
@ -30,7 +30,7 @@ CEventLoop::CEventLoop()
{
if (!s_event_loop_stack) {
s_event_loop_stack = new Vector<CEventLoop*>;
s_timers = new HashMap<int, OwnPtr<CEventLoop::EventLoopTimer>>;
s_timers = new HashMap<int, NonnullOwnPtr<CEventLoop::EventLoopTimer>>;
s_notifiers = new HashTable<CNotifier*>;
}

View file

@ -81,7 +81,7 @@ private:
bool has_expired(const timeval& now) const;
};
static HashMap<int, OwnPtr<EventLoopTimer>>* s_timers;
static HashMap<int, NonnullOwnPtr<EventLoopTimer>>* s_timers;
static int s_next_timer_id;
static HashTable<CNotifier*>* s_notifiers;

View file

@ -35,7 +35,7 @@ private:
MetadataForIndex& ensure_metadata_for_index(const GModelIndex&) const;
mutable HashMap<void*, OwnPtr<MetadataForIndex>> m_view_metadata;
mutable HashMap<void*, NonnullOwnPtr<MetadataForIndex>> m_view_metadata;
RefPtr<GraphicsBitmap> m_expand_bitmap;
RefPtr<GraphicsBitmap> m_collapse_bitmap;