On Thu, Apr 04, 2002 at 10:03:08AM -0400, Garst R. Reese wrote:
> > >>         if (!isValidLength(a) || !isValidLength(b) ||
> > >>             !isValidLength(c) || !isValidLength(d))
> > 
> > this looks better to me
> > 
> >           if !(isValidLength(a) && isValidLength(b) &&
> >                isValidLength(c) && isValidLength(d))
> > 
> looks better, but couldn't the other version bail out on the first true
> !isValidLength, and the second require evaluating all?

No, the second considers the inner expression first, sees tha
isValidLength(a) is false, skips the rest, negates the result...

Exactly the same amount of work.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)

Reply via email to