The &&
operator “short-circuits” – that is, if the left condition is false, it doesn’t bother evaluating the right one.
Similarly, the ||
operator short-circuits if the left condition is true.
EDIT: Though, you shouldn’t worry about performance until you’ve benchmarked and determined that it’s a problem. Premature micro-optimization is the bane of maintainability.