<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/7608">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">cdr: Minor optimizations.<br><br>* bridge_candidate_process: remove SCOPED_AO2LOCK and return value.<br>* handle_standard_bridge_enter_message: replace recursive call with goto<br> statement.<br><br>ASTERISK-24297<br><br>Change-Id: Id2eaa0822fb8dc799f63422bb3aa89de9d4ee2a2<br>---<br>M main/cdr.c<br>1 file changed, 10 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/cdr.c b/main/cdr.c<br>index 3681cdc..0e03668 100644<br>--- a/main/cdr.c<br>+++ b/main/cdr.c<br>@@ -2457,12 +2457,12 @@<br> * \param cand_cdr The \ref cdr_object that is a candidate<br> *<br> */<br>-static int bridge_candidate_process(struct cdr_object *cdr, struct cdr_object *base_cand_cdr)<br>+static void bridge_candidate_process(struct cdr_object *cdr, struct cdr_object *base_cand_cdr)<br> {<br> struct cdr_object_snapshot *party_a;<br> struct cdr_object *cand_cdr;<br> <br>- SCOPED_AO2LOCK(lock, base_cand_cdr);<br>+ ao2_lock(base_cand_cdr);<br> <br> for (cand_cdr = base_cand_cdr; cand_cdr; cand_cdr = cand_cdr->next) {<br> /* Skip any records that are not in this bridge */<br>@@ -2474,7 +2474,7 @@<br> if (!strcasecmp(cdr->party_a.snapshot->name, cand_cdr->party_a.snapshot->name)<br> || (cdr->party_b.snapshot<br> && !strcasecmp(cdr->party_b.snapshot->name, cand_cdr->party_a.snapshot->name))) {<br>- return 0;<br>+ break;<br> }<br> <br> party_a = cdr_object_pick_party_a(&cdr->party_a, &cand_cdr->party_a);<br>@@ -2482,7 +2482,7 @@<br> * Party B */<br> if (!strcasecmp(party_a->snapshot->name, cdr->party_a.snapshot->name)) {<br> bridge_candidate_add_to_cdr(cdr, &cand_cdr->party_a);<br>- return 0;<br>+ break;<br> }<br> <br> /* We're Party B. Check if we can add ourselves immediately or if we need<br>@@ -2502,9 +2502,11 @@<br> */<br> memset(&cand_cdr->end, 0, sizeof(cand_cdr->end));<br> }<br>- return 0;<br>+<br>+ break;<br> }<br>- return 0;<br>+<br>+ ao2_unlock(base_cand_cdr);<br> }<br> <br> /*!<br>@@ -2587,6 +2589,7 @@<br> <br> ao2_lock(cdr);<br> <br>+try_again:<br> for (it_cdr = cdr; it_cdr; it_cdr = it_cdr->next) {<br> if (it_cdr->fn_table->process_party_a) {<br> CDR_DEBUG("%p - Updating Party A %s snapshot\n", it_cdr,<br>@@ -2639,7 +2642,7 @@<br> /* This is guaranteed to succeed: the new CDR is created in the single state<br> * and will be able to handle the bridge enter message<br> */<br>- handle_standard_bridge_enter_message(cdr, bridge, channel);<br>+ goto try_again;<br> }<br> }<br> ao2_unlock(cdr);<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7608">change 7608</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/7608"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Id2eaa0822fb8dc799f63422bb3aa89de9d4ee2a2 </div>
<div style="display:none"> Gerrit-Change-Number: 7608 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>