[asterisk-dev] [Code Review]: Iterate though cdr.conf setting

Paul Belanger reviewboard at asterisk.org
Sun Sep 11 02:31:11 CDT 2011



> On Sept. 11, 2011, 12:38 a.m., Tilghman Lesher wrote:
> > trunk/main/cdr.c, lines 1561-1587
> > <https://reviewboard.asterisk.org/r/1426/diff/1/?file=20492#file20492line1561>
> >
> >     I'd like these all to be extended as a continuous 'else if'.  This saves considerable CPU, as once one of them matches, the loop can short-circuit, instead of needlessly comparing against more values (that we know won't match).

Ya, I am not sure what I was thinking here.  Fixed.


- Paul


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1426/#review4279
-----------------------------------------------------------


On Sept. 10, 2011, 2:57 p.m., Paul Belanger wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1426/
> -----------------------------------------------------------
> 
> (Updated Sept. 10, 2011, 2:57 p.m.)
> 
> 
> Review request for Asterisk Developers and leifmadsen.
> 
> 
> Summary
> -------
> 
> We had some internal discussions this week about how to update configuration files so they worked the same across all modules.  In this example, I've updated cdr.conf to use the same method of iterating over all .conf file variables.  Most people agreed this was the proper way to parse a configuration file.
> 
> If we all agreed, I'd like this method to become the standard way used for parsing configuration file.  Obviously we have some questions that need to be answered, specifically this _may_ break existing configuration files if a duplicate variable is declared later in a .conf file (AKA unused garbage settings).
> 
> FWIW: This is how we do it for manager.conf, features.conf, sip.conf, plus various other modules.
> 
> Thoughts? 
> 
> 
> Diffs
> -----
> 
>   trunk/main/cdr.c 335124 
> 
> Diff: https://reviewboard.asterisk.org/r/1426/diff
> 
> 
> Testing
> -------
> 
> Local asterisk box.
> 
> 
> Thanks,
> 
> Paul
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110911/a57ebe8d/attachment-0001.htm>


More information about the asterisk-dev mailing list