From 55a4b0a21efdb7ffae7172deabbabaf178c05c92 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 7 May 2024 20:00:37 +0200 Subject: [PATCH] LibJS: Mark Value as a trivial type for AK collection purposes It's perfectly fine to memcpy() a bunch of JS::Values around, and if that helps Vector go faster, let's allow it. --- Userland/Libraries/LibJS/Runtime/Value.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibJS/Runtime/Value.h b/Userland/Libraries/LibJS/Runtime/Value.h index f22e161de64..f1ebf841d3a 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.h +++ b/Userland/Libraries/LibJS/Runtime/Value.h @@ -735,6 +735,7 @@ struct Formatter : Formatter { template<> struct Traits : DefaultTraits { static unsigned hash(JS::Value value) { return Traits::hash(value.encoded()); } + static constexpr bool is_trivial() { return true; } }; }