From 93489fbc4c3bee24262e7d9240fa307454ed2a05 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 24 Jul 2019 08:42:55 +0200 Subject: [PATCH] Convert HashMap> to HashMap>. In every case I found, we never wanted to support null entry values. With NonnullOwnPtr, we can encode that at the type level. :^) --- Applications/ProcessManager/ProcessModel.h | 2 +- Applications/Taskbar/WindowList.h | 2 +- Kernel/SharedBuffer.cpp | 6 +++--- Kernel/SharedBuffer.h | 2 +- Libraries/LibCore/CEventLoop.cpp | 4 ++-- Libraries/LibCore/CEventLoop.h | 2 +- Libraries/LibGUI/GTreeView.h | 2 +- Servers/WindowServer/WSClientConnection.h | 6 +++--- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Applications/ProcessManager/ProcessModel.h b/Applications/ProcessManager/ProcessModel.h index 046823ba9a6..21003a6666f 100644 --- a/Applications/ProcessManager/ProcessModel.h +++ b/Applications/ProcessManager/ProcessModel.h @@ -58,7 +58,7 @@ private: }; HashMap m_usernames; - HashMap> m_processes; + HashMap> m_processes; Vector m_pids; RefPtr m_generic_process_icon; RefPtr m_high_priority_icon; diff --git a/Applications/Taskbar/WindowList.h b/Applications/Taskbar/WindowList.h index d706d27eb44..b8d9be2eb62 100644 --- a/Applications/Taskbar/WindowList.h +++ b/Applications/Taskbar/WindowList.h @@ -78,5 +78,5 @@ public: Function aid_create_button; private: - HashMap> m_windows; + HashMap> m_windows; }; diff --git a/Kernel/SharedBuffer.cpp b/Kernel/SharedBuffer.cpp index 7fe077b5c89..29665e3bc94 100644 --- a/Kernel/SharedBuffer.cpp +++ b/Kernel/SharedBuffer.cpp @@ -1,11 +1,11 @@ #include #include -Lockable>>& shared_buffers() +Lockable>>& shared_buffers() { - static Lockable>>* map; + static Lockable>>* map; if (!map) - map = new Lockable>>; + map = new Lockable>>; return *map; } diff --git a/Kernel/SharedBuffer.h b/Kernel/SharedBuffer.h index 6b408bb3f89..e7791868924 100644 --- a/Kernel/SharedBuffer.h +++ b/Kernel/SharedBuffer.h @@ -49,4 +49,4 @@ public: unsigned m_total_refs { 0 }; }; -Lockable>>& shared_buffers(); +Lockable>>& shared_buffers(); diff --git a/Libraries/LibCore/CEventLoop.cpp b/Libraries/LibCore/CEventLoop.cpp index 123d3749e2f..719e1369501 100644 --- a/Libraries/LibCore/CEventLoop.cpp +++ b/Libraries/LibCore/CEventLoop.cpp @@ -21,7 +21,7 @@ static CEventLoop* s_main_event_loop; static Vector* s_event_loop_stack; -HashMap>* CEventLoop::s_timers; +HashMap>* CEventLoop::s_timers; HashTable* 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; - s_timers = new HashMap>; + s_timers = new HashMap>; s_notifiers = new HashTable; } diff --git a/Libraries/LibCore/CEventLoop.h b/Libraries/LibCore/CEventLoop.h index a5370cc428b..54bbf1d240a 100644 --- a/Libraries/LibCore/CEventLoop.h +++ b/Libraries/LibCore/CEventLoop.h @@ -81,7 +81,7 @@ private: bool has_expired(const timeval& now) const; }; - static HashMap>* s_timers; + static HashMap>* s_timers; static int s_next_timer_id; static HashTable* s_notifiers; diff --git a/Libraries/LibGUI/GTreeView.h b/Libraries/LibGUI/GTreeView.h index 6fe0df6e696..55241d2376d 100644 --- a/Libraries/LibGUI/GTreeView.h +++ b/Libraries/LibGUI/GTreeView.h @@ -35,7 +35,7 @@ private: MetadataForIndex& ensure_metadata_for_index(const GModelIndex&) const; - mutable HashMap> m_view_metadata; + mutable HashMap> m_view_metadata; RefPtr m_expand_bitmap; RefPtr m_collapse_bitmap; diff --git a/Servers/WindowServer/WSClientConnection.h b/Servers/WindowServer/WSClientConnection.h index 2a5d2e47498..1138a945508 100644 --- a/Servers/WindowServer/WSClientConnection.h +++ b/Servers/WindowServer/WSClientConnection.h @@ -78,9 +78,9 @@ private: void post_error(const String&); - HashMap> m_windows; - HashMap> m_menubars; - HashMap> m_menus; + HashMap> m_windows; + HashMap> m_menubars; + HashMap> m_menus; WeakPtr m_app_menubar; int m_next_menubar_id { 10000 };