mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:27:45 +00:00
LibJS+AK: Use Vector<u16, 1> for UTF-16 string storage
It's very common to encounter single-character strings in JavaScript on the web. We can make such strings significantly lighter by having a 1-character inline capacity on the Vectors.
This commit is contained in:
parent
ae0bdda86e
commit
024367d82e
7 changed files with 27 additions and 26 deletions
|
@ -139,7 +139,7 @@ public:
|
|||
return view;
|
||||
}
|
||||
|
||||
RegexStringView construct_as_same(Span<u32> data, Optional<String>& optional_string_storage, Vector<u16>& optional_utf16_storage) const
|
||||
RegexStringView construct_as_same(Span<u32> data, Optional<String>& optional_string_storage, Vector<u16, 1>& optional_utf16_storage) const
|
||||
{
|
||||
auto view = m_view.visit(
|
||||
[&]<typename T>(T const&) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue