Skip to content

[DeadCode] Alternative: add NopVisitor for removing Nop same line previous stmt just removed#3548

Closed
samsonasik wants to merge 7 commits intomainfrom
alternative-remove-nop
Closed

[DeadCode] Alternative: add NopVisitor for removing Nop same line previous stmt just removed#3548
samsonasik wants to merge 7 commits intomainfrom
alternative-remove-nop

Conversation

@samsonasik
Copy link
Copy Markdown
Member

@TomasVotruba
Copy link
Copy Markdown
Member

Go for merge when ready 👍

@samsonasik
Copy link
Copy Markdown
Member Author

@TomasVotruba I am thinking that it may be slow down the process refactor as it require another loop after node refactored for usage of new visitor to loop node stmts just to clearance the Nop usage.

It also rely on NodesToRemoveCollector usage, which it will still buggy on remove by $node->stmts[$key] usage in other rule if used as no previous key may be 2 things;

  • previous stmt never exists before.
  • previous stmt just unsetted.

I think we can have this case by case for it, so closing it for now.

@samsonasik samsonasik closed this Apr 1, 2023
@samsonasik samsonasik deleted the alternative-remove-nop branch April 1, 2023 19:36
@TomasVotruba
Copy link
Copy Markdown
Member

I see, makes sense 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants