Skip to content
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

Delete local variable declarations that are never read from #110

Open
KCreate opened this issue Jul 27, 2022 · 0 comments
Open

Delete local variable declarations that are never read from #110

KCreate opened this issue Jul 27, 2022 · 0 comments

Comments

@KCreate
Copy link
Owner

KCreate commented Jul 27, 2022

Variable declarations that are never read from can be safely removed. If the declaration has any side-effects, only those side effects must still be included, but the actual variable declaration must not.

This can be implemented by giving each declaration node a list of nodes that reference it, if that list if empty at the end of the block, the declaration can be removed.

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

No branches or pull requests

1 participant