[asterisk-bugs] [Asterisk 0012120]: [patch] unnecessary complex expression in last build_user() modification

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Mar 3 05:24:16 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12120 
====================================================================== 
Reported By:                flefoll
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   12120
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 104095 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             03-03-2008 03:19 CST
Last Modified:              03-03-2008 05:24 CST
====================================================================== 
Summary:                    [patch] unnecessary complex expression in last
build_user() modification
Description: 
An additional "alt" argument was introduced for build_user() in chan_sip.c
rev 104095, and exit condition in for() loop was modified.

But I read it and read it again, and I can't see any difference between
former
for (; v; v = v->next)
and new
for (; v || ((v = alt) && !(alt=NULL)); v = v->next)

In both cases, the exit condition can be summarized to "v is not NULL".
But I think that former expression is much more readable.

====================================================================== 

---------------------------------------------------------------------- 
 flefoll - 03-03-08 05:24  
---------------------------------------------------------------------- 
OOOPS !

I didn't catch the embedded double affectation "v=alt" and "alt=NULL".
Shame on me...
The first patch I proposed is totally inadequate. I propose another one
that just inserts a comment for people like me...

Anyway, the best thing that can happen to this issue is to be closed now
:-) 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
03-03-08 05:24  flefoll        Note Added: 0083253                          
======================================================================




More information about the asterisk-bugs mailing list