cond. op. on ='s LHS

Paul Beusterien paulb at ssd.csd.harris.com
Thu Feb 14 08:39:22 AEST 1991


In article <11073 at pasteur.Berkeley.EDU>  johnm at cory.Berkeley.EDU (John D. Mitchell) writes:
:In article <4155 at cernvax.cern.ch> burow at cernvax.cern.ch (burkhard burow) writes:
::I'm wondering if anyone has any comments on using:
::       *(a==b?&c:&d) = 1;
::instead of:
::       if (a==b) c=1;
::       else      d=1;
:
:1) Readability, readability, READABILITY!
:
:2) Why?  It's not any faster.

Its probably slower, since it is a lot less likely the compiler
will keep c and d in registers.
--
Paul Beusterien                          paulb at ssd.csd.harris.com
Harris Computer Systems        {uunet,mit-eddie,novavax}!hcx1!paulb
Ft. Lauderdale, FL                     voice: (305) 973 5270



More information about the Comp.lang.c mailing list