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

Optimize if-statement tests #736

Closed
wants to merge 19 commits into from
Closed

Conversation

j-f1
Copy link
Contributor

@j-f1 j-f1 commented Nov 19, 2017

These optimizations are only safe when applied to expressions where only the truthiness or falsiness​ of the result is important. Therefore, I’ve applied them to:

  1. Ternary tests
  2. if or while statement tests
  3. The LHS of logical operators that are either:
    1. the only expression in an ExpressionStatement or
    2. not the last expression in a SequenceExpression

Ref #25.

@j-f1 j-f1 requested a review from boopathi as a code owner November 19, 2017 22:43
@j-f1
Copy link
Contributor Author

j-f1 commented Jul 4, 2018

@boopathi This should be good to go.

@j-f1 j-f1 closed this Mar 5, 2020
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.

1 participant