_select_sdcch_for_call: Avoid 2nd lchan lookup when finally selecting it

We already looked it up, it's not necessary to look it up again by
calling lchan_select_by_type(). Let's instead call
lchan_select_set_type() directly on the lchan pointer.

Related: SYS#5309
Change-Id: I1054c18f58c9e249f263e3e97a365a1fd8b03a93
This commit is contained in:
Pau Espin 2021-07-15 13:28:38 +02:00 committed by pespin
parent 2956b52c5b
commit ce869c6baa
1 changed files with 1 additions and 2 deletions

View File

@ -1964,8 +1964,7 @@ struct gsm_lchan *_select_sdcch_for_call(struct gsm_bts *bts, const struct chan_
}
select_lchan:
/* FIXME: we already have lchan, simply do lchan->type = GSM_LCHAN_SDCCH? Split lchan_select_by_type in 2 functions? */
lchan = lchan_select_by_type(bts, GSM_LCHAN_SDCCH);
lchan_select_set_type(lchan, GSM_LCHAN_SDCCH);
return lchan;
}