mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:37:35 +00:00
LibJS: Make Lexer::s_keywords store keywords as FlyString
This allows O(1) comparison against lexed keywords, since we lex to FlyString.
This commit is contained in:
parent
bf46845819
commit
8bde4e94d8
2 changed files with 2 additions and 2 deletions
|
@ -16,7 +16,7 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
HashMap<String, TokenType> Lexer::s_keywords;
|
||||
HashMap<FlyString, TokenType> Lexer::s_keywords;
|
||||
HashMap<String, TokenType> Lexer::s_three_char_tokens;
|
||||
HashMap<String, TokenType> Lexer::s_two_char_tokens;
|
||||
HashMap<char, TokenType> Lexer::s_single_char_tokens;
|
||||
|
|
|
@ -77,7 +77,7 @@ private:
|
|||
|
||||
bool m_allow_html_comments { true };
|
||||
|
||||
static HashMap<String, TokenType> s_keywords;
|
||||
static HashMap<FlyString, TokenType> s_keywords;
|
||||
static HashMap<String, TokenType> s_three_char_tokens;
|
||||
static HashMap<String, TokenType> s_two_char_tokens;
|
||||
static HashMap<char, TokenType> s_single_char_tokens;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue