It looks like there is an exponential increase in time complexity when evaluating arguments with a null value. For n terms, the first term is evaluated 2n-1 times, the second term is evaluated 2n-2 times, and so on.
This appears to be caused by the Visit(BinaryExpression) method which uses null as a sentinel value to indicate whether the left or right side has already been lazily evaluated. This change adds two booleans to track whether the halves have been visited.
This PR addresses #60, I've ensured all unit tests pass, and added additional tests to ensure nulls are evaluated as expected and within a reasonable time period.
It looks like there is an exponential increase in time complexity when evaluating arguments with a null value. For n terms, the first term is evaluated 2n-1 times, the second term is evaluated 2n-2 times, and so on.
This appears to be caused by the Visit(BinaryExpression) method which uses null as a sentinel value to indicate whether the left or right side has already been lazily evaluated. This change adds two booleans to track whether the halves have been visited.
This PR addresses #60, I've ensured all unit tests pass, and added additional tests to ensure nulls are evaluated as expected and within a reasonable time period.