

if(true || complexFunction()) ... if(false && complexFunction()) ...In both examples complexFunction() will never be executed since it is unnecessary to evaluate the expression. So if your looking for that extra bit of performance, it's always good practice when forming potentially intensive logical comparisons, to put the least complicated comparisons first.
This site is licensed under a
Creative Commons License