mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibJS: Cache an Utf16View for the full code string in SourceCode
This avoids doing the ASCII/UTF-16 flag check every time we access character data from the lexer.
This commit is contained in:
parent
fa44fd58d8
commit
7c7a035347
Notes:
github-actions[bot]
2025-11-09 11:15:08 +00:00
Author: https://github.com/awesomekling
Commit: 7c7a035347
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6764
4 changed files with 40 additions and 36 deletions
|
|
@ -20,6 +20,7 @@ NonnullRefPtr<SourceCode const> SourceCode::create(String filename, Utf16String
|
|||
SourceCode::SourceCode(String filename, Utf16String code)
|
||||
: m_filename(move(filename))
|
||||
, m_code(move(code))
|
||||
, m_code_view(m_code.utf16_view())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue