From 4abafbbe3c5bb647e3edd48a201deef0a211d07b Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 22 Dec 2022 21:29:36 -0500 Subject: [PATCH] LibIPC: Remove requirement that Variant types must begin with Empty This is no longer required by the decoder. --- Userland/Libraries/LibIPC/Encoder.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Userland/Libraries/LibIPC/Encoder.h b/Userland/Libraries/LibIPC/Encoder.h index 1d1696a4a0..e8bc3b0606 100644 --- a/Userland/Libraries/LibIPC/Encoder.h +++ b/Userland/Libraries/LibIPC/Encoder.h @@ -89,12 +89,9 @@ public: return *this; } - // Note: We require any encodeable variant to have Empty as its first variant, as only possibly-empty variants can be default constructed. - // The default constructability is required by generated IPC message marshalling code. template - Encoder& operator<<(AK::Variant const& variant) + Encoder& operator<<(AK::Variant const& variant) { - // Note: This might be either u8 or size_t depending on the size of the variant; both are encodeable. *this << variant.index(); variant.visit([this](auto const& underlying_value) { *this << underlying_value; }); return *this;