cosmetic: lchan_sacch_get: early-exit instead of nested-if

Change-Id: I1fbf7d7f619cc8194c8094cf4a1826b6114f0e11
This commit is contained in:
Neels Hofmeyr 2017-02-08 18:12:22 +01:00 committed by Harald Welte
parent 7a18906cfa
commit ae50f7dac2
1 changed files with 4 additions and 4 deletions

View File

@ -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;
}