diff options
author | Timothy Flynn <trflynn89@pm.me> | 2022-01-17 22:02:50 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-01-18 09:46:55 +0000 |
commit | 444b2d9ec2e962235e2ea7c15c8457c8627d7ca2 (patch) | |
tree | a795128102e45324dda93ac11f5beb2247af51f3 /Meta | |
parent | 567b3a481076083a6a5ad0e443bbaca71e396e44 (diff) | |
download | serenity-444b2d9ec2e962235e2ea7c15c8457c8627d7ca2.zip |
LibJS: Implement UTF-16 surrogate pair concatenation without iteration
Performance of string concatenation regressed in a57e2f9. That commit
iterates over the LHS string to find the last code unit, to check if it
is a high surrogate. Instead, first look at the 3rd-to-last byte in the
UTF-8 encoded string to check if it is a 3-byte code point; then decode
just those bytes to check if we have a high surrogate. Similarly, check
the first 3 bytes of the RHS string to check if we have a low surrogate.
Diffstat (limited to 'Meta')
0 files changed, 0 insertions, 0 deletions