aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.cpp
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-04-26 18:02:52 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2021-04-26 18:02:54 +0200
commit34f61af3d041ee38262095e630758652e16b93fe (patch)
treedd5950e9990f2885bc44948c09c46cd9cc4a4da1 /src/tbf.cpp
parent2ab840a1faaa56a026948c7d7b9bd9c1dcdb2d1c (diff)
sched: Simplify else-if condition
The code path running into first call of "create_packet_access_reject()" is a superset condition of the second one, so the second one will never be hit. As a result first, this block: """ else if (tbf == tbfs->ul_ass && tbf->direction == GPRS_RLCMAC_DL_TBF) if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) msg = tbfs->ul_ass->create_packet_access_reject(); else msg = tbfs->ul_ass->create_ul_ass(fn, ts); """ Can be simplified into: """ else if (tbf == tbfs->ul_ass && tbf->direction == GPRS_RLCMAC_DL_TBF && !tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) msg = tbfs->ul_ass->create_ul_ass(fn, ts); """ Next, one can see that previous condition still forces !tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) to be always true if we ever reach that code, so it can be dropped. Change-Id: I62e2255e28fc4f43fe0a31259ebf18ad00e7e357
Diffstat (limited to 'src/tbf.cpp')
0 files changed, 0 insertions, 0 deletions