Skip to content

Conversation

@CPunisher
Copy link
Member

Description:

The only use of start is in error span read_digits so I think it can be removed.

@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2025

🦋 Changeset detected

Latest 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-hq
Copy link

codspeed-hq bot commented Oct 28, 2025

CodSpeed Performance Report

Merging #11201 will not alter performance

Comparing CPunisher:10-29-perf/remove-state-start (cf7c14e) with main (eda01e5)

Summary

✅ 138 untouched

@kdy1 kdy1 added this to the Planned milestone Oct 29, 2025
@kdy1 kdy1 self-assigned this Oct 30, 2025
@CPunisher CPunisher force-pushed the 10-29-perf/remove-state-start branch from a23e695 to 608d308 Compare November 3, 2025 09:06
@CPunisher CPunisher marked this pull request as ready for review November 3, 2025 09:06
@CPunisher CPunisher requested a review from a team as a code owner November 3, 2025 09:06
Copilot AI review requested due to automatic review settings November 3, 2025 09:06
Copy link
Contributor

Copilot AI left a 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: BytePos field from the State struct
  • Removed the start() getter method from the State implementation
  • Removed assignments to self.state.start in next_token() and scan_jsx_token()
  • Updated read_int_u32() to use self.cur_pos() instead of self.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.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

Binary Sizes

File Size
swc.linux-x64-gnu.node 31M (31933320 bytes)

Commit: dd41528

@kdy1 kdy1 requested a review from a team as a code owner November 3, 2025 10:05
@kdy1 kdy1 merged commit b9aeaa3 into swc-project:main Nov 3, 2025
23 checks passed
@kdy1 kdy1 modified the milestones: Planned, 1.15.0 Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants