1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 05:27:14 +09:00

LibJS: Add and use PrimitiveString::length_in_utf16_code_units

I was investigating an optimization in this area, and while it
didn't seem to have a noticable improvement, it still seems
useful to apply this change.
This commit is contained in:
Shannon Booth 2025-05-04 00:06:34 +12:00 committed by Andreas Kling
parent 560317b3d0
commit e476d21ed0
Notes: github-actions[bot] 2025-05-03 14:19:42 +00:00
5 changed files with 12 additions and 9 deletions

View file

@ -980,7 +980,7 @@ inline ThrowCompletionOr<Value> get_by_id(VM& vm, Optional<IdentifierTableIndex>
{
if constexpr (mode == GetByIdMode::Length) {
if (base_value.is_string()) {
return Value(base_value.as_string().utf16_string().length_in_code_units());
return Value(base_value.as_string().length_in_utf16_code_units());
}
}