AK: Use simdutf when appending UTF-16 to StringBuilder

Adds a fast path for valid UTF-16 using `simdutf`, and fall back to
the slow path for unmatched surrogates.
This commit is contained in:
Jonne Ransijn 2024-10-26 11:05:31 +02:00 committed by Andreas Kling
commit 04920d06f0
Notes: github-actions[bot] 2024-10-30 09:29:15 +00:00
4 changed files with 120 additions and 17 deletions

View file

@ -109,6 +109,8 @@ public:
u16 const* data() const { return m_code_units.data(); }
char16_t const* char_data() const { return reinterpret_cast<char16_t const*>(data()); }
ReadonlySpan<u16> span() const { return m_code_units; }
u16 code_unit_at(size_t index) const;
u32 code_point_at(size_t index) const;