AK: Shrink Utf16View from 40 bytes to 32 bytes

This ends up making RegexStringView smaller, which means less stuff to
copy when forking in the regex engine.

Thanks to Leon for suggesting the [[no_unique_address]] trick!
This commit is contained in:
Andreas Kling 2025-04-08 20:53:34 +02:00 committed by Andreas Kling
commit b2779ad9f7
Notes: github-actions[bot] 2025-04-09 05:23:14 +00:00

View file

@ -138,7 +138,7 @@ private:
size_t calculate_length_in_code_points() const;
ReadonlySpan<u16> m_code_units;
mutable Optional<size_t> m_length_in_code_points;
[[no_unique_address]] mutable Optional<size_t> m_length_in_code_points;
Endianness m_endianness { Endianness::Host };
};