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

Improved how expressions are simplified to eliminate sub-expressions that can be evaluated #173

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

danielmittelman
Copy link

This pull request changes how the simplify() function works when dealing with expressions that can be simplified even further.

Example 1:

true and true or true

Before the change, this would have evaluated to something like true and (true or (true)). Yet, since this is an expression that can already be simplified to a single literal, it now evaluates to:

true

Example 2:

(5 > 2) or x > 8

Now, when running simplify(), this will evaluate to true or (x > 8). When running simplify({x: 10}), this will evaluate to true.

@silentmatt
Copy link
Owner

This is really cool. I'll take a look at it and try to get this merged for the next release.

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.

2 participants