fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-msc/+/38510?usp=email )
Change subject: csd_bs: cosmetic changes to csd_bs_list_to_bearer_cap() ......................................................................
Patch Set 1:
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/osmo-msc/+/38510/comment/9f26c164_6a681744?usp=... : PS1, Line 7: csd_bs: cosmetic changes to csd_bs_list_to_bearer_cap()
Allocating a var in the stack every loop iteration
This is incorrect, because a loop does not have its own stack frame, only functions do. This simply reduces the usage scope of a variable, in theory allowing the compiler to optimize code better. The resulting binary may or may not change, depending on the compiler and the `-O` level.
Marking the variable as const
So that the compiler can avoid allocating stack memory for it and access `list->bs[i]` directly.
By "the way this function behaves though" I meant the output it produces given the same input. Again, we can keep discussing this forever, but the core logic of this function remains unchanged.