delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/16/22:27:58

Message-ID: <3882841C.E6FC16E5@lycosmail.com>
Date: Sun, 16 Jan 2000 21:53:16 -0500
From: Adam Schrotenboer <ajschrotenboer AT lycosmail DOT com>
X-Mailer: Mozilla 4.7 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Question on 'if' statements...
References: <38823564 DOT 37F9F865 AT ou DOT edu>
Reply-To: djgpp AT delorie DOT com

David Cleaver wrote:

> Hello all,
>
> I was wondering about how DJGPP would handle a very large if statement
> which contained alot of '&&' in it.  Does the compiler make it so that
> the instant it hits a 'false' value it breaks out, or does it continue
> through all of tests and then does the '&&' operation(s) later?  I need
> to know in order to try and optimize a program that I am writing.  Any
> help you can give will be greatly appreciated.  Thanks for you time.
>
> -David C.

Does it have any '||' in it?? Otherwise, the C def req's shortcut
evaluation, so yes, if I understand correctly, it will exit out as soon as
the statement is known to be false. (A little vague, I know. I only know a
little bit from some comp.sci courses I took a few years back)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019