-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
perf(es/parser): Remove start in State
#11201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(es/parser): Remove start in State
#11201
Conversation
🦋 Changeset detectedLatest commit: cf7c14e The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
CodSpeed Performance ReportMerging #11201 will not alter performanceComparing Summary
|
a23e695 to
608d308
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the unused start field from the lexer's State struct and its associated getter method. The field was previously set but never actually used, making it redundant.
Key Changes
- Removed the
start: BytePosfield from theStatestruct - Removed the
start()getter method from theStateimplementation - Removed assignments to
self.state.startinnext_token()andscan_jsx_token() - Updated
read_int_u32()to useself.cur_pos()instead ofself.state().start()
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/swc_ecma_parser/src/lexer/state.rs | Removed the unused start field from State struct, its initialization, assignments, getter method, and commented-out debug code |
| crates/swc_ecma_parser/src/lexer/mod.rs | Updated read_int_u32() to call self.cur_pos() directly instead of accessing the removed start field via self.state().start() |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Binary Sizes
Commit: dd41528 |
Description:
The only use of
startis in error spanread_digitsso I think it can be removed.