diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-02-08 18:12:22 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-02-10 12:18:49 +0000 |
commit | ae50f7dac2585fdf423ed452bd0c4f05396ac541 (patch) | |
tree | f537f9e4a3530d01ff717b27b940b90bfbf9b53b | |
parent | all models: fix vty write: bts_model_config_write_phy (diff) | |
download | OsmoBTS-ae50f7dac2585fdf423ed452bd0c4f05396ac541.tar.xz OsmoBTS-ae50f7dac2585fdf423ed452bd0c4f05396ac541.zip |
cosmetic: lchan_sacch_get: early-exit instead of nested-if
Change-Id: I1fbf7d7f619cc8194c8094cf4a1826b6114f0e11
-rw-r--r-- | src/common/sysinfo.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index d0a476d3..177ed587 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -151,10 +151,10 @@ uint8_t *lchan_sacch_get(struct gsm_lchan *lchan) uint32_t tmp; for (tmp = lchan->si.last + 1; tmp != lchan->si.last; tmp = (tmp + 1) % _MAX_SYSINFO_TYPE) { - if (lchan->si.valid & (1 << tmp)) { - lchan->si.last = tmp; - return lchan->si.buf[tmp]; - } + if (!(lchan->si.valid & (1 << tmp))) + continue; + lchan->si.last = tmp; + return lchan->si.buf[tmp]; } return NULL; } |