Skip to content

Commit

Permalink
fix: improve lexing inline elements step's performance (#3146)
Browse files Browse the repository at this point in the history
* refac: improve lexing inline elements step's performance

* refac: clear out queue after tokens have been inlined
  • Loading branch information
SpencerWhitehead7 committed Dec 31, 2023
1 parent baed07a commit 4f87b2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Lexer.ts
Expand Up @@ -89,10 +89,11 @@ export class _Lexer {

this.blockTokens(src, this.tokens);

let next;
while (next = this.inlineQueue.shift()) {
for (let i = 0; i < this.inlineQueue.length; i++) {
const next = this.inlineQueue[i];
this.inlineTokens(next.src, next.tokens);
}
this.inlineQueue = [];

return this.tokens;
}
Expand Down

1 comment on commit 4f87b2a

@vercel
Copy link

@vercel vercel bot commented on 4f87b2a Dec 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.