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:
Andreas Kling 2021-10-02 17:37:15 +02:00
commit 024367d82e
Notes: sideshowbarker 2024-07-18 03:12:34 +09:00
7 changed files with 27 additions and 26 deletions

View file

@ -16,10 +16,10 @@
namespace AK {
Vector<u16> utf8_to_utf16(StringView const&);
Vector<u16> utf8_to_utf16(Utf8View const&);
Vector<u16> utf32_to_utf16(Utf32View const&);
void code_point_to_utf16(Vector<u16>&, u32);
Vector<u16, 1> utf8_to_utf16(StringView const&);
Vector<u16, 1> utf8_to_utf16(Utf8View const&);
Vector<u16, 1> utf32_to_utf16(Utf32View const&);
void code_point_to_utf16(Vector<u16, 1>&, u32);
class Utf16View;