-
-
Notifications
You must be signed in to change notification settings - Fork 721
refactor(minifier): inline statement methods #13044
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
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
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 refactors the minifier's peephole optimization code by inlining statement methods for better performance and code organization. The refactoring changes method signatures from returning Option<Statement> to directly mutating the statement in place.
- Consolidates dead code removal logic into individual statement type methods
- Eliminates the central
remove_dead_code_exit_statementdispatcher method - Changes method signatures to take
&mut Statementand mutate in place rather than returning new statements
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| remove_unused_declaration.rs | Updates function and class declaration removal methods to mutate statements in place |
| remove_dead_code.rs | Refactors all statement optimization methods to use direct mutation pattern |
| mod.rs | Replaces centralized dispatcher with explicit match statements in exit_statement methods |
| minimize_expression_in_boolean_context.rs | Removes the try_fold_stmt_in_boolean_context helper method |
| minifier.rs | Uncomments a debug print statement for testing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Instrumentation Performance ReportMerging #13044 will not alter performanceComparing Summary
Footnotes |
c050149 to
7381231
Compare
No description provided.