From 943ecaede62065a2b64f537a9de58944db92df21 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sun, 14 May 2023 23:04:47 +0200 Subject: [PATCH] LibIPC: Remove redundant IPC::Dictionary type We already have and use HashMap nearly everywhere, which is essentially equivalent. --- .../Tools/CodeGenerators/IPCCompiler/main.cpp | 1 - Userland/Libraries/LibIPC/Decoder.cpp | 16 ------ Userland/Libraries/LibIPC/Decoder.h | 3 - Userland/Libraries/LibIPC/Dictionary.h | 55 ------------------- Userland/Libraries/LibIPC/Encoder.cpp | 15 ----- Userland/Libraries/LibIPC/Encoder.h | 3 - Userland/Libraries/LibIPC/Forward.h | 1 - 7 files changed, 94 deletions(-) delete mode 100644 Userland/Libraries/LibIPC/Dictionary.h diff --git a/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp index 03dba12c79..2a4781a015 100644 --- a/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp @@ -779,7 +779,6 @@ void build(StringBuilder& builder, Vector const& endpoints) #include #include #include -#include #include #include #include diff --git a/Userland/Libraries/LibIPC/Decoder.cpp b/Userland/Libraries/LibIPC/Decoder.cpp index ea9870b812..fccfa96045 100644 --- a/Userland/Libraries/LibIPC/Decoder.cpp +++ b/Userland/Libraries/LibIPC/Decoder.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include @@ -84,21 +83,6 @@ ErrorOr decode(Decoder& decoder) return URL { url }; } -template<> -ErrorOr decode(Decoder& decoder) -{ - auto size = TRY(decoder.decode_size()); - Dictionary dictionary {}; - - for (size_t i = 0; i < size; ++i) { - auto key = TRY(decoder.decode()); - auto value = TRY(decoder.decode()); - dictionary.add(move(key), move(value)); - } - - return dictionary; -} - template<> ErrorOr decode(Decoder& decoder) { diff --git a/Userland/Libraries/LibIPC/Decoder.h b/Userland/Libraries/LibIPC/Decoder.h index 512a1bf2b7..f81c41fce7 100644 --- a/Userland/Libraries/LibIPC/Decoder.h +++ b/Userland/Libraries/LibIPC/Decoder.h @@ -99,9 +99,6 @@ ErrorOr