Path: utzoo!attcan!uunet!vsi!sullivan From: sullivan@vsi.UUCP (Michael T Sullivan) Newsgroups: comp.lang.c Subject: Re: C IF statement efficiency... Summary: ?: Message-ID: <801@vsi.UUCP> Date: 18 Aug 88 15:17:54 GMT References: <8808171400.AA05122@ucbvax.Berkeley.EDU> Organization: V-Systems, Inc. -- Santa Ana, CA Lines: 19 In article <8808171400.AA05122@ucbvax.Berkeley.EDU>, U23405@UICVM writes: > I was wondering if, of the two following program fragments, which one would > be compiled more efficiently by most C compilers: > > if (big > small) if (big > small) > return big; return big; > else return small; > return small; Let's throw return (big > small ? big : small); into the consideration pile as well. -- Michael Sullivan {uunet|attmail}!vsi!sullivan V-Systems, Inc. Santa Ana, CA sullivan@vsi.com "Your mother was a hamster and your father smelled of eldeberries! Pbbbt!"