mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 02:59:45 +00:00
AK+LibJS: Do not set UTF-16 code point length to its code unit length
This commit is contained in:
parent
594194eb60
commit
efa9737cf7
Notes:
github-actions[bot]
2025-06-25 20:22:15 +00:00
Author: https://github.com/trflynn89
Commit: efa9737cf7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5214
Reviewed-by: https://github.com/gmta ✅
3 changed files with 25 additions and 1 deletions
|
@ -113,6 +113,13 @@ public:
|
|||
size_t length_in_code_units() const { return m_code_units.size(); }
|
||||
size_t length_in_code_points() const;
|
||||
|
||||
Optional<size_t> length_in_code_points_if_known() const
|
||||
{
|
||||
if (m_length_in_code_points == NumericLimits<size_t>::max())
|
||||
return {};
|
||||
return m_length_in_code_points;
|
||||
}
|
||||
|
||||
Utf16CodePointIterator begin() const { return { begin_ptr(), m_code_units.size() }; }
|
||||
Utf16CodePointIterator end() const { return { end_ptr(), 0 }; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue