Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site zinfandel.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!zehntel!zinfandel!berry From: berry@zinfandel.UUCP (Berry Kercheval) Newsgroups: net.lang.c Subject: Re: Which is better? Message-ID: <262@zinfandel.UUCP> Date: Mon, 10-Dec-84 15:23:28 EST Article-I.D.: zinfande.262 Posted: Mon Dec 10 15:23:28 1984 Date-Received: Tue, 11-Dec-84 07:36:15 EST References: <13900013@acf4.UUCP> Reply-To: berry@zinfandel.UUCP (Berry Kercheval) Organization: Zehntel Inc., Walnut Creek, CA Lines: 36 Summary: In article <13900013@acf4.UUCP> greenber@acf4.UUCP writes: > >Which (in general!) generates "better" code within a switch or loop? > > if (condition) > { > code.... > break; > } > other code.... > break; >-------------------------------OR--------------- > if (condition) > { > code.... > } > else > { > other code..... > } > break; > > >Ross M. Greenberg @ NYU ----> allegra!cmcl2!acf4!greenber <---- IN GENERAL it is impossible to tell, as it is VERY dependent on the particular compiler you have, and the machine you are generating code for. The only way is to try both, look at the assembly output and make a decision. Why didn't you do that? -- Berry Kercheval Zehntel Inc. (ihnp4!zehntel!zinfandel!berry) (415)932-6900