diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-07-03 15:23:56 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-07-03 15:49:38 +0200 |
commit | d6dbb1b987afe0dbc86692c8dd5f27e873b1630c (patch) | |
tree | d8de518bc682a480f0a6b22f470b216762eb8985 | |
parent | be9cd66020ee1e32a66b95edbfec06b36dde4980 (diff) |
Transceiver: Simplify code on early error return when calling detectAnyBurst
We get rid of one branch and simplify code logic.
Change-Id: I026e35262bfe42c3d23ebdc06d84e4908a8380e2
-rw-r--r-- | Transceiver52M/Transceiver.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 7f05a2c..81b428a 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -650,20 +650,16 @@ bool Transceiver::pullRadioVector(size_t chan, struct trx_ul_burst_ind *bi) /* Detect normal or RACH bursts */ rc = detectAnyBurst(*burst, mTSC, BURST_THRESH, mSPSRx, type, amp, toa, max_toa); - - if (rc > 0) { - type = (CorrType) rc; - } else if (rc <= 0) { - if (rc == -SIGERR_CLIP) { + if (rc <= 0) { + if (rc == -SIGERR_CLIP) LOG(WARNING) << "Clipping detected on received RACH or Normal Burst"; - } else if (rc != SIGERR_NONE) { + else if (rc != SIGERR_NONE) LOG(WARNING) << "Unhandled RACH or Normal Burst detection error"; - } - delete radio_burst; return false; } + type = (CorrType) rc; bi->toa = toa; rxBurst = demodAnyBurst(*burst, mSPSRx, amp, toa, type); |