Skip to content

How does the "short circuit evaluation of conditions" work? #1241

Answered by WarmUpTill
Tpal12 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,
There is no custom short circuit logic implementation done on my side, as I am simply relying on C++ doing the short circuit evaluation for me here.

If the current "condition evaluation result" of a macro cannot change with a given logical operator and the given input parameters the evaluation of a condition is skipped.

Let's assume you have the following conditions in a macro ...

... and the state of the conditions is:

  • File => true
  • Scene => false
  • Timer => true

The conditions will be evaluated from top to bottom resulting in this expression having to evaluate to true for the macro to be executed:

((File || Scene) && Timer)

As the File check returns true, the Scene check will be ski…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Tpal12
Comment options

@WarmUpTill
Comment options

@Tpal12
Comment options

Answer selected by Tpal12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants