summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Lexer.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-18 18:34:51 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-18 19:54:24 +0200
commit8bde4e94d874e2b741ed65a5447e132915eead34 (patch)
treed81dc922ce2134a09ea5d702d3a947ecf2fabf4e /Userland/Libraries/LibJS/Lexer.cpp
parentbf46845819a1575a41531789bfa11dbaef25e706 (diff)
downloadserenity-8bde4e94d874e2b741ed65a5447e132915eead34.zip
LibJS: Make Lexer::s_keywords store keywords as FlyString
This allows O(1) comparison against lexed keywords, since we lex to FlyString.
Diffstat (limited to 'Userland/Libraries/LibJS/Lexer.cpp')
-rw-r--r--Userland/Libraries/LibJS/Lexer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Lexer.cpp b/Userland/Libraries/LibJS/Lexer.cpp
index 7b58a84f32..f9c0d31de7 100644
--- a/Userland/Libraries/LibJS/Lexer.cpp
+++ b/Userland/Libraries/LibJS/Lexer.cpp
@@ -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;