<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/23909">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">sched: Simplify else-if condition<br><br>The code path running into first call of "create_packet_access_reject()"<br>is a superset condition of the second one, so the second one will never<br>be hit.<br><br>As a result first, this block:<br>"""<br>else if (tbf == tbfs->ul_ass && tbf->direction == GPRS_RLCMAC_DL_TBF)<br> if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ))<br> msg = tbfs->ul_ass->create_packet_access_reject();<br> else<br> msg = tbfs->ul_ass->create_ul_ass(fn, ts);<br>"""<br><br>Can be simplified into:<br>"""<br>else if (tbf == tbfs->ul_ass && tbf->direction == GPRS_RLCMAC_DL_TBF &&<br> !tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ))<br> msg = tbfs->ul_ass->create_ul_ass(fn, ts);<br>"""<br><br>Next, one can see that previous condition still forces<br>!tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) to be always true<br>if we ever reach that code, so it can be dropped.<br><br>Change-Id: I62e2255e28fc4f43fe0a31259ebf18ad00e7e357<br>---<br>M src/gprs_rlcmac_sched.cpp<br>1 file changed, 2 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/09/23909/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp</span><br><span>index ab7e57e..85c9be8 100644</span><br><span>--- a/src/gprs_rlcmac_sched.cpp</span><br><span>+++ b/src/gprs_rlcmac_sched.cpp</span><br><span>@@ -175,12 +175,8 @@</span><br><span> */</span><br><span> if (tbf == tbfs->ul_ass && tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ))</span><br><span> msg = tbfs->ul_ass->create_packet_access_reject();</span><br><span style="color: hsl(0, 100%, 40%);">- else if (tbf == tbfs->ul_ass && tbf->direction ==</span><br><span style="color: hsl(0, 100%, 40%);">- GPRS_RLCMAC_DL_TBF)</span><br><span style="color: hsl(0, 100%, 40%);">- if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ))</span><br><span style="color: hsl(0, 100%, 40%);">- msg = tbfs->ul_ass->create_packet_access_reject();</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- msg = tbfs->ul_ass->create_ul_ass(fn, ts);</span><br><span style="color: hsl(120, 100%, 40%);">+ else if (tbf == tbfs->ul_ass && tbf->direction == GPRS_RLCMAC_DL_TBF)</span><br><span style="color: hsl(120, 100%, 40%);">+ msg = tbfs->ul_ass->create_ul_ass(fn, ts);</span><br><span> else if (tbf == tbfs->dl_ass && tbf->direction == GPRS_RLCMAC_UL_TBF)</span><br><span> msg = tbfs->dl_ass->create_dl_ass(fn, ts);</span><br><span> else if (tbf == tbfs->ul_ack)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/23909">change 23909</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.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.osmocom.org/c/osmo-pcu/+/23909"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: osmo-pcu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I62e2255e28fc4f43fe0a31259ebf18ad00e7e357 </div>
<div style="display:none"> Gerrit-Change-Number: 23909 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>