I am having a code, which contains
bool fn()
{
...
//all the following are boolean functions.
return isTrue()
&&isMsgReceived()
&&isMsgSent();
}
The problem is that each of the return boolean functions are themselves quite lengthy and takes much computation. Actually, there is no point in checking subsequent functions, if previous one already failed (and
condition).
Would you suggest simpler ways to return false
, in case one of the beginning functions already failed and not go for further checking. The aim is to reduce compute time.