From a97d75bb63a1aa280f024ab8b36ba26f237ab7d0 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 25 Oct 2021 13:28:51 +0200 Subject: [PATCH] LibJS: Add default constructor for PrivateName This avoids a round-trip through FlyString("") for every Reference. --- Userland/Libraries/LibJS/Runtime/PrivateEnvironment.h | 1 + Userland/Libraries/LibJS/Runtime/Reference.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.h b/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.h index 92266f35fe..c50d200f16 100644 --- a/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.h +++ b/Userland/Libraries/LibJS/Runtime/PrivateEnvironment.h @@ -12,6 +12,7 @@ namespace JS { struct PrivateName { + PrivateName() = default; PrivateName(u64 unique_id, FlyString description) : unique_id(unique_id) , description(move(description)) diff --git a/Userland/Libraries/LibJS/Runtime/Reference.h b/Userland/Libraries/LibJS/Runtime/Reference.h index b202869e35..ac31b61e61 100644 --- a/Userland/Libraries/LibJS/Runtime/Reference.h +++ b/Userland/Libraries/LibJS/Runtime/Reference.h @@ -153,7 +153,7 @@ private: bool m_is_private { false }; // FIXME: This can (probably) be an union with m_name. - PrivateName m_private_name { 0, "" }; + PrivateName m_private_name; Optional m_environment_coordinate; };