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:
parent
560317b3d0
commit
e476d21ed0
Notes:
github-actions[bot]
2025-05-03 14:19:42 +00:00
Author: https://github.com/shannonbooth
Commit: e476d21ed0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4571
5 changed files with 12 additions and 9 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue