In C#, given the two methods
bool Action1(object Data);
bool Action2(object Data);
that are used in an if statement like this:
if ( Action1(Data) || (Action2(Data) )
{
PerformOtherAction();
}
will Action2() still be called if Action1() returned true, or is this prevented by compiler optimisation, since it is already known that the expression will evaluate to true?
Action2() will only be called if Action1() returns false
This is conceptually similar to