[asterisk-dev] strange libss7 coding style!

Russell Bryant russell at digium.com
Thu Jul 23 19:32:02 CDT 2009


tian wrote:
> Hi, guys!

Hi!

Please create a new message instead of reply to another one when 
starting a new thread.

> suppose that A, B, C and D are some boolean expressions, the libss7 code 
> used something like this:
> 
> if (  (A && B) ? 1 : (C || D)  )
>     // statements when condition is true
> 
> 
> I think the following would be equivalent and more clean
> 
> if (   (A && B) || (C || D)   )
>     // statements when condition is true
> 
> 
> I think this is strange coding style and am wondering what benefit can we 
> get from this? Do you?

Agreed.  Patches that simplify logic like this are welcome.

-- 
Russell Bryant
Digium, Inc. | Engineering Manager, Open Source Software
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list