[asterisk-bugs] [JIRA] (ASTERISK-24297) cdr.c: Minor code optimizations.

Richard Mudgett (JIRA) noreply at issues.asterisk.org
Wed Sep 3 15:58:28 CDT 2014


Richard Mudgett created ASTERISK-24297:
------------------------------------------

             Summary: cdr.c: Minor code optimizations.
                 Key: ASTERISK-24297
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24297
             Project: Asterisk
          Issue Type: Improvement
      Security Level: None
          Components: CDR/General
            Reporter: Richard Mudgett


>From https://reviewboard.asterisk.org/r/3964/ I made a couple code optimization suggestions.

In bridge_candidate_process():
* Nothing cares about the return value.

* The RAII_VAR and SCOPED_AO2LOCK can easily be eliminated by changing the "return 0" statements in the for loop to breaks.

In handle_standard_bridge_enter_message():
* There is a tail recursion that could be eliminated by pulling the main for loop in the function into its own routine.  Then the cdr lock also won't be recursively obtained.




--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list