fixeria has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/36086?usp=email )
Change subject: cosmetic: reduce nesting in osmo_ss7_as_find_by_proto() ......................................................................
cosmetic: reduce nesting in osmo_ss7_as_find_by_proto()
Change-Id: I16e460b91f57bea6606c111335257d717d5423d0 Related: SYS#5424 --- M src/osmo_ss7.c 1 file changed, 19 insertions(+), 10 deletions(-)
Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified osmith: Looks good to me, approved
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index dbbef6b..dadb68e 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -915,18 +915,17 @@ /* Loop through the list with AS and try to find one where the proto matches up */ llist_for_each_entry(as, &inst->as_list, list) { - if (as->cfg.proto == proto) { + if (as->cfg.proto != proto) + continue;
- /* Put down the first AS that matches the proto, just in - * case we will not find any matching ASP */ - if (!as_without_asp) - as_without_asp = as; + /* Put down the first AS that matches the proto, just in + * case we will not find any matching ASP */ + if (!as_without_asp) + as_without_asp = as;
- /* Check if the candicate we have here has any suitable - * ASP */ - if (osmo_ss7_asp_find_by_proto(as, proto)) - return as; - } + /* Check if the candicate we have here has any suitable ASP */ + if (osmo_ss7_asp_find_by_proto(as, proto)) + return as; }
/* Return with the second best find, if there is any */