Fredeke
Senior Member
Sorry for flooding the forum... But I'm diving deep into scripting today, so I'm having a few questions.
Do we know in which order conditional statements are evaluated in KSP ?
Here's what I mean: if write something like
the interpreter first evaluates one of the conditions (either A or B, depending on the language), and then only evaluates the other if it's relevant to do so. In this example, it would only evaluate the latter if the former is true, because if the former is false, then it knows the whole condition will be false anyway.
Knowing this, we can optimize our code for speed by tweaking the order of such statements. I'd like very much to do that, because sometimes I can hardly avoid complex conditions within loops.
So, does anyone know which side of and/or operators gets evaluated first ?
Do we know in which order conditional statements are evaluated in KSP ?
Here's what I mean: if write something like
Code:
if (condition A and condition B)
Knowing this, we can optimize our code for speed by tweaking the order of such statements. I'd like very much to do that, because sometimes I can hardly avoid complex conditions within loops.
So, does anyone know which side of and/or operators gets evaluated first ?
Last edited: