Which is better?

Berry Kercheval berry at zinfandel.UUCP
Tue Dec 11 06:23:28 AEST 1984


In article <13900013 at acf4.UUCP> greenber at 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



More information about the Comp.lang.c mailing list