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

Lint patterns like a && (a || b) which can be simplified #590

Closed
llogiq opened this issue Jan 29, 2016 · 2 comments
Closed

Lint patterns like a && (a || b) which can be simplified #590

llogiq opened this issue Jan 29, 2016 · 2 comments
Labels
A-lint Area: New lints E-medium Call for participation: Medium difficulty level problem and requires some initial experience. T-AST Type: Requires working with the AST

Comments

@llogiq
Copy link
Contributor

llogiq commented Jan 29, 2016

Shamelessly grabbed from http://www.viva64.com/en/d/0320/ 😄

@oli-obk
Copy link
Contributor

oli-obk commented Jan 29, 2016

We can do full simplification of the boolean expression and compare the results. That'll catch arbitrary cases of it.

@Manishearth Manishearth added E-medium Call for participation: Medium difficulty level problem and requires some initial experience. T-AST Type: Requires working with the AST A-lint Area: New lints labels Jan 29, 2016
@Manishearth
Copy link
Member

Note that often you may write a boolean expression in a nonsimplified manner because that mirrors the intent. Not sure if this is an edge case or common though.

@oli-obk oli-obk mentioned this issue Mar 23, 2016
7 tasks
@mcarton mcarton closed this as completed Mar 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints E-medium Call for participation: Medium difficulty level problem and requires some initial experience. T-AST Type: Requires working with the AST
Projects
None yet
Development

No branches or pull requests

4 participants