mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
perf(parser): get and check lookahead token (#4534)
This commit is contained in:
parent
d914b14275
commit
0870ee1f9f
1 changed files with 2 additions and 2 deletions
|
|
@ -170,8 +170,8 @@ impl<'a> Lexer<'a> {
|
|||
let n = n as usize;
|
||||
debug_assert!(n > 0);
|
||||
|
||||
if self.lookahead.len() > n - 1 {
|
||||
return self.lookahead[n - 1].token;
|
||||
if let Some(lookahead) = self.lookahead.get(n - 1) {
|
||||
return lookahead.token;
|
||||
}
|
||||
|
||||
let position = self.source.position();
|
||||
|
|
|
|||
Loading…
Reference in a new issue