mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 04:42:10 +00:00
perf(lexer): only check the first lower case for match_keyword (#913)
This commit is contained in:
parent
a6d8d05cd3
commit
f447cf3a3b
1 changed files with 1 additions and 1 deletions
|
|
@ -371,7 +371,7 @@ impl Kind {
|
|||
|
||||
pub fn match_keyword(s: &str) -> Self {
|
||||
let len = s.len();
|
||||
if len == 1 || len >= 12 {
|
||||
if len <= 1 || len >= 12 || !s.as_bytes()[0].is_ascii_lowercase() {
|
||||
return Ident;
|
||||
}
|
||||
Self::match_keyword_impl(s)
|
||||
|
|
|
|||
Loading…
Reference in a new issue