mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibJS: Cache length-in-code-units in SourceCode
This avoids some bit twiddling whenever accessing the length in code units in the lexer.
This commit is contained in:
parent
7c7a035347
commit
201803f601
Notes:
github-actions[bot]
2025-11-09 11:15:02 +00:00
Author: https://github.com/awesomekling
Commit: 201803f601
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6764
3 changed files with 16 additions and 13 deletions
|
|
@ -21,6 +21,7 @@ SourceCode::SourceCode(String filename, Utf16String code)
|
|||
: m_filename(move(filename))
|
||||
, m_code(move(code))
|
||||
, m_code_view(m_code.utf16_view())
|
||||
, m_length_in_code_units(m_code_view.length_in_code_units())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue