feat(minifier): exit point optimization#23914
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbf37e7315
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@Dunqing let me know if you see anything wrong |
|
i'm actually debating if this is correct way to implement this, doing recursive loop over all child's is not ideal, this could be done way cleaner if we could trace up, or we would store information if current statement block is last within scope |
|
sadly there is no way to check this with ancestry, as we can't in safe way check if an last element :( |
|
after further investigation, it looks like this should not be needed, eg. #24672 |
After many trial and errors, this seem to be the best way to remove break stmts in switch cases, This change targets only last break in last case of switch smts if its unlabelled this change differs from #23914 as its no longer targets all branches as that should not be no longer necessary if all cases are correctly rewritten #24672 ----- cases like `switch (a) { case 3: if (b) break; }` are not changed ----- ref: #17544
expanded version of break/continue/return optimization