<p>Patch set 2:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11535">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/11535/2/channels/chan_dahdi.c">File channels/chan_dahdi.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11535/2/channels/chan_dahdi.c@11949">Patch Set #2, Line 11949:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">                struct r2link_entry *tmp = NULL;<br>              int new_idx = r2links_count + 1;<br>              int i;<br>                for (i = 1; i <= r2links_count; i++) {<br>                     int i_unused = 1;<br>                     AST_LIST_TRAVERSE(&r2links, tmp, list) {<br>                          if (i == tmp->mfcr2.index) {<br>                                       i_unused = 0;<br>                                 break;<br>                                }<br>                     }<br>                     if (i_unused) {<br>                               new_idx = i;<br>                          break;<br>                        }<br>             }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This loop appears to be unneeded. If the index needs to be unique, and is always set on a new link then  you can just set the index to rlinks_count and forego the look up loop. I may be missing something but I don't see how i_unused would ever be set to zero?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11535/2/channels/chan_dahdi.c@19466">Patch Set #2, Line 19466:</a> <code style="font-family:monospace,monospace">            int x = 0;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">variable 'x' appears to be unused aside from incrementing below, so can be removed.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11535">change 11535</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/11535"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: Ibcb2401515a58782a1488c0b9efbed201c3f3a17 </div>
<div style="display:none"> Gerrit-Change-Number: 11535 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Oron Peled <oron.peled@xorcom.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Tzafrir Cohen <tzafrir.cohen@xorcom.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 19 Jul 2019 20:07:48 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>