mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 10:48:53 +00:00
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<Value> go faster, let's allow it.
This commit is contained in:
parent
161298b5d1
commit
55a4b0a21e
Notes:
sideshowbarker
2024-07-17 11:33:34 +09:00
Author: https://github.com/awesomekling
Commit: 55a4b0a21e
Pull-request: https://github.com/SerenityOS/serenity/pull/24260
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/mattco98
1 changed files with 1 additions and 0 deletions
|
@ -735,6 +735,7 @@ struct Formatter<JS::Value> : Formatter<StringView> {
|
|||
template<>
|
||||
struct Traits<JS::Value> : DefaultTraits<JS::Value> {
|
||||
static unsigned hash(JS::Value value) { return Traits<u64>::hash(value.encoded()); }
|
||||
static constexpr bool is_trivial() { return true; }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue